日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

html5内容切换特效,html5+jQuery图片和文字内容同时左右切换特效

發(fā)布時間:2023/12/15 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html5内容切换特效,html5+jQuery图片和文字内容同时左右切换特效 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

html5+jQuery圖片和文字內(nèi)容同時左右切換特效,點(diǎn)擊圖片或者點(diǎn)擊左右按鈕進(jìn)行切換,圖片轉(zhuǎn)動以及文字內(nèi)容動畫效果切換。

查看演示

下載資源:

22

次 下載資源

下載積分:

20

積分

js代碼

(function(){

var bannerIndex = 0;

var $bannerBgs = $('.js_banner-bg');

var $bannerNotifications = $('.js_banner-notification');

function changeTopBanner(index) {

$bannerBgs.removeClass('mui-enter-active');

$($bannerBgs[index]).addClass('mui-enter-active');

$bannerNotifications.removeClass('mui-enter-active');

$($bannerNotifications[index]).addClass('mui-enter-active');

}

setInterval(function(){

if (bannerIndex < 2) {

bannerIndex++;

changeTopBanner(bannerIndex);

} else {

bannerIndex = 0;

changeTopBanner(bannerIndex);

}

}, 6000);

// Function

var functionIndex = 1;

function presentScreen(index) {

$('.carousel').removeClass(

'present-screen-1 present-screen-2 present-screen-3'

).addClass(`present-screen-${functionIndex}`);

}

var $titles = $('.js_function-text .title');

var $descs = $('.js_function-text .desc');

function presentText(index) {

index = index - 1;

$titles.removeClass('mui-enter-active');

$($titles[index]).addClass('mui-enter-active');

$descs.removeClass('mui-enter-active');

$($descs[index]).addClass('mui-enter-active');

}

var $functionScreens = $('.carousel .function-screen');

for (var i = 0; i < $functionScreens.length; i++) {

(function (i) {

$($functionScreens[i]).click(function(){

functionIndex = i + 1;

presentScreen(functionIndex);

presentText(functionIndex);

})

})(i);

}

$('#js_function-orbit-prev').click(function(){

functionIndex > 1 ? functionIndex-- : functionIndex = 3;

presentScreen(functionIndex);

presentText(functionIndex);

});

$('#js_function-orbit-next').click(function(){

functionIndex < 3 ? functionIndex++ : functionIndex = 1;

presentScreen(functionIndex);

presentText(functionIndex);

});

var newsOrbit = new Foundation.Orbit($('#js_news-thumbnail'));

})()

總結(jié)

以上是生活随笔為你收集整理的html5内容切换特效,html5+jQuery图片和文字内容同时左右切换特效的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。