![完善JQuery圖片切換效果的簡(jiǎn)潔實(shí)現(xiàn)__第1頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-7/19/b36c5728-4197-4f22-8f28-27d663bad71f/b36c5728-4197-4f22-8f28-27d663bad71f1.gif)
![完善JQuery圖片切換效果的簡(jiǎn)潔實(shí)現(xiàn)__第2頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-7/19/b36c5728-4197-4f22-8f28-27d663bad71f/b36c5728-4197-4f22-8f28-27d663bad71f2.gif)
![完善JQuery圖片切換效果的簡(jiǎn)潔實(shí)現(xiàn)__第3頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-7/19/b36c5728-4197-4f22-8f28-27d663bad71f/b36c5728-4197-4f22-8f28-27d663bad71f3.gif)
![完善JQuery圖片切換效果的簡(jiǎn)潔實(shí)現(xiàn)__第4頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-7/19/b36c5728-4197-4f22-8f28-27d663bad71f/b36c5728-4197-4f22-8f28-27d663bad71f4.gif)
![完善JQuery圖片切換效果的簡(jiǎn)潔實(shí)現(xiàn)__第5頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-7/19/b36c5728-4197-4f22-8f28-27d663bad71f/b36c5728-4197-4f22-8f28-27d663bad71f5.gif)
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、完善JQuery圖片切換效果的簡(jiǎn)潔實(shí)現(xiàn)_ 下面我就為大家?guī)?lái)一篇完善JQuery圖片切換效果的簡(jiǎn)潔實(shí)現(xiàn)。我覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。 css: body font-family:Microsoft Yahei; body,ul,li,img,h3,dl,dd,dt,h1margin:0px;padding:0px;list-style:none; imgvertical-align: top; /*大圖切換*/ .scroll_viewmargin: 0px auto;overflow:hidden;position: relative; .photo_view lip
2、osition:absolute;width: 100%; .photo_view li em,.photo_view li h3position: absolute;bottom: 0px;z-index: 1;height: 35px;line-height: 35px;width: 100%;left: 0px; .photo_view li emz-index: 1;background:rgba(0,0,0,0.5);filter: progid:DXImageTransform.Microsoft.gradient( GradientType = 0,startColorstr =
3、 #50000000,endColorstr = #50000000);_background:#000; .photo_view li h3z-index: 2;text-indent: 1em;font-weight: normal; .photo_view li h3 acolor:#fff; .photo_view li h3 a:hovercolor:#f60; .small_photoposition: absolute;bottom: 40px;right: 10px;cursor: pointer;z-index: 4; .small_photo li float: left;
4、padding-right: 10px; .small_photo li imgwidth: 80px;height: 35px;border: solid 2px #ccc;border-radius: 2px; .small_photo li.active imgborder: solid 2px #f60; html: !- start:大圖切換 - div class=scroll_view ul class=photo_view liimg src=images/ad1.jpg alt= class= /em/emh3a href=javascript:void(0);圖片效果1/a
5、/h3/li liimg src=images/ad2.jpg alt= class= /em/emh3a href=javascript:void(0);圖片效果2/a/h3/li liimg src=images/ad3.jpg alt= class= /em/emh3a href=javascript:void(0);圖片效果3/a/h3/li liimg src=images/ad4.jpg alt= class= /em/emh3a href=javascript:void(0);圖片效果4/a/h3/li /ul ul class=small_photo/ul /div !- En
6、d:大圖切換 - js: $.fn.extend( imgScroll:function(options) var def=phtot_parent:$(.scroll_view),photo_view:$(.photo_view),small_photo:$(.small_photo),speed:800,isauto:true,width:800,height:349, opt=$.extend(,def,options), $photo_view=opt.photo_view, $small_photo=opt.small_photo, speed=opt.speed, isauto=o
7、pt.isauto, index=0, _length=$photo_view.find(li).length, strTime=null; opt.phtot_parent.css(width:opt.width,height:opt.height); $photo_view.find(li:not(:first).hide()/.find(img).hide(); $photo_view.find(li).each(function(i) $small_photo.append(liimg src=+$(this).find(img).attr(src)+ alt= class= /li)
8、; ) $small_photo.find(li:first).addClass(active); /小圖鼠標(biāo)動(dòng)作 $small_photo.find(li).bind(mouseenter,function() clearInterval(strTime); if(index!=$(this).index() index=$(this).index(); animate(index) ).bind(mouseleave,function() if(isauto) start(); ); /大圖懸停動(dòng)作 $photo_view.find(li).bind(mouseenter,function
9、() clearInterval(strTime); ).bind(mouseleave,function() if(isauto) start(); ); /自動(dòng)播放 if(isauto) start(); /啟動(dòng)自動(dòng)播放 function start() strTime=setInterval(function() index = _length-1 ? index=0 : index+; animate(index); ,speed); /動(dòng)畫效果 function animate(_index)/console.log(_index) $small_photo.find(li).eq(
10、_index).addClass(active).siblings().removeClass(active);/轉(zhuǎn)變小圖導(dǎo)航樣式 $photo_view.find(li).eq(_index).css(z-index,1).siblings().css(z-index,0);/掌握absolute的層級(jí) $photo_view.find(li).eq(_index).show().find(img).css(opacity: 0); /裝大圖的opacity設(shè)置為0 $photo_view.find(li).eq(_index).find(img).animate(opacity:1,300,function() $(this).removeAttr(style);/動(dòng)畫之后刪除opacity $photo_view.find(li).eq(_index).show().siblings().hide();/顯示大圖 );/展現(xiàn)當(dāng)前顯示動(dòng)畫 ); script type=text/javascript $(function(
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025至2031年中國(guó)雙柄奶鍋行業(yè)投資前景及策略咨詢研究報(bào)告
- 2025至2031年中國(guó)五香豆干行業(yè)投資前景及策略咨詢研究報(bào)告
- 2025至2030年中國(guó)阻燃劑聚磷酸銨數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 2025年中國(guó)自行刻紋機(jī)市場(chǎng)調(diào)查研究報(bào)告
- 2025年中國(guó)混凝土拌合物維勃稠度儀市場(chǎng)調(diào)查研究報(bào)告
- 6《狼牙山五壯士》第一課時(shí)教學(xué)設(shè)計(jì)-2024-2025學(xué)年語(yǔ)文六年級(jí)上冊(cè)統(tǒng)編版
- Moduke9 Unit 3 Language in use 教學(xué)設(shè)計(jì) 2024-2025學(xué)年外研版八年級(jí)英語(yǔ)上冊(cè)
- 2024-2025學(xué)年八年級(jí)物理上冊(cè)第四章光現(xiàn)象第3節(jié)平面鏡成像作業(yè)設(shè)計(jì)新版新人教版
- 2024-2025學(xué)年新教材高中數(shù)學(xué)第五章統(tǒng)計(jì)與概率5.3.2事件之間的關(guān)系與運(yùn)算應(yīng)用案鞏固提升新人教B版必修第二冊(cè)
- 負(fù)數(shù)的認(rèn)識(shí)(教學(xué)設(shè)計(jì))-2023-2024學(xué)年六年級(jí)下冊(cè)數(shù)學(xué)人教版
- 5000只淮山羊和波爾山羊雜交良種養(yǎng)殖場(chǎng)建設(shè)項(xiàng)目可行性研究報(bào)告
- GB/T 5534-2008動(dòng)植物油脂皂化值的測(cè)定
- GB/T 12771-2019流體輸送用不銹鋼焊接鋼管
- 測(cè)量管理體系內(nèi)審檢查表
- 工程驗(yàn)收及移交管理方案
- 心臟手術(shù)麻醉的一般流程課件
- 圖片編輯概述課件
- 2023年岳陽(yáng)職業(yè)技術(shù)學(xué)院?jiǎn)握新殬I(yè)技能考試筆試題庫(kù)及答案解析
- 信號(hào)與系統(tǒng)復(fù)習(xí)題及答案
- 北師大版八年級(jí)數(shù)學(xué)上冊(cè)《認(rèn)識(shí)無(wú)理數(shù)(第2課時(shí))》參考課件2
- 中級(jí)建構(gòu)筑物消防員理論綜合模擬題01原題
評(píng)論
0/150
提交評(píng)論