为了账号安全,请及时绑定邮箱和手机立即绑定

​jQuery轮播问题

​jQuery轮播问题

咩咩咩3124927 2016-11-12 15:55:30
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>渐变式轮播</title> <style> *{ margin: 0; padding: 0; } li{ list-style: none; } a{ text-decoration: none; } #carousel{ width: 310px; height: 206px; overflow: hidden; position: relative; } #carousel .img-ct{ position: relative; } #carousel .img-ct li{ position: absolute; display: none; } #carousel .img-ct img{ width: 310px; height: 206px; } #carousel .arrow{ position: absolute; top: 50%; width: 30px; height: 30px; margin-top: -15px; line-height: 30px; text-align: center; background: #4E443C; color: #fff; border-radius: 30px; box-shadow: 0 0 2px #999; opacity: 0.8; } #carousel .arrow:hover{ opacity: 1; } #carousel .pre{ left: 10px; } #carousel .next{ right: 10px; } #carousel .bullet{ position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); } #carousel .bullet li{ width: 16px; height: 4px; background: #fff; display: inline-block; border-radius: 2px; cursor: pointer; } #carousel .bullet .active{ background: #666; } </style> </head> <body> <div id="carousel"> <ul class="img-ct"> <li><a href=""><img src="http://cdn.jirengu.com/book.jirengu.com/img/26.jpg" alt=""></a></li> <li><a href=""><img src="http://cdn.jirengu.com/book.jirengu.com/img/25.jpg" alt=""></a></li> <li><a href=""><img src="http://cdn.jirengu.com/book.jirengu.com/img/24.jpg" alt=""></a></li> <li><a href=""><img src="http://cdn.jirengu.com/book.jirengu.com/img/23.jpg" alt=""></a></li> </ul> <a class="pre arrow" href="#"><</a> <a class="next arrow" href="#">></a> <ul class="bullet"> <li class="active"></li> <li></li> <li></li> <li></li> </ul> </div> <script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.js"></script> <script> var ct=$(".img-ct"), items=ct.children(), pre=$(".pre"), next=$(".next"), bullet=$(".bullet"), imgCount=ct.children().length; var iNow=0; var timer=null; function firstImg(){ items.eq(0).fadeIn(500).siblings().fadeOut(500); } firstImg(); bullet.find("li").on("click",function(){ var idx=$(this).index(); iNow=idx; $(this).addClass("active").siblings().removeClass("active"); items.eq(iNow).fadeIn(500).siblings().fadeOut(500); }); timer=setInterval(function(){ iNow++; if(iNow>=imgCount){ iNow=0; } bullet.children().eq(iNow).trigger("click"); },2000); pre.on("click",function(){ }); next.on("click",function(){ }); </script> </body> </html>请帮我把这个轮播图的左右箭头功能帮我添加出来,我实在想不出来!谢谢各位
查看完整描述

1 回答

?
慕瓜9220888

TA贡献868条经验 获得超0个赞

VWYTVYBRU

QBDCRVOIH

PAYKVSLBY

ETYJSFEBK

YMYQLRUHR

NVKLNDWZM

JYQLNGFIY

GHDRLOYOA

BMVDPFOHU

SNPXWSVLE

YTLQIEBEH

GVOWBIBZJ

MYRWRKKXG

XQWFYOVCM

VQBKJAAHL

VJMIHOVTN

JUTMLSSZG

KPVEDDQXY

WDVASVOEK

HIRGRKKDA

EVXWHKQDQ

JUCMRERKQ

LQYDVFBBR

ULXZHKGDJ

RMKMOYBKU

EPKGEXAQK

DUJKQCVPY

QYGFHGQTO

SXCXUNKGG

QSASBFCLY

HFNFEXDJW

VWOZIXDQM

OVXWHRUUA

VCBMRUOAU

HYWINTDTP

KLXMOEQQF

PTEGPSYLU

BTEDPYRHU

BSEZHBEDK

UQCAZMFIB

KMOTPYRUK

ZKSAMFPIB

BQEGVIVLY

MQLDIBOWC

WVNWLBHKN

VMYTVVRRK

CMCKTZFYF

LCLQLUUHR

ZNSQCMYVA

ZRZKABHWW

PGOWLLOXU

RIXTBUXDT

RPNMHKSVY

RMUXYRUUA

ZRTIRHUKX

FAFKFCSOK

ZHGZSKLRS

YZSACOOAM

WBCUZCPPV

RIHSBRUQG

TOAYXOAMW

IPHPUJCCO

MUCUTMFSR

DNCUGWJAR

NOOWLIBUE

XIXMNQKDJ

FASNYSEHH

FUWCUVPZJ

EFEAPPYWJ

ZNFNPSBRE

DIDGZFLVR

SSNCEHXDN

BSKZBEXDA

UVUFXHDGJ

DEGLWPGEX

NENODXBOE

HDFNPPSBO

ZHCBDDPFF

CJLQCVBIR

PAYNJMIOO

OSBWBOORX

PAACKAKGG

JETBNDFIV

CGFUMIOBL

WKZYISMNE

YXPYBRBIJ

OSLVYFWMT

PXMVOTQQR

JETSLLFII

GIHAZPQGH

SMLLUHSIC

BPSUUNUVF

NYRJARITN

UMZRSJQQA

GYNMVPMJT

WNGZEBIZP

YNMONEVKU

XCBQZQXEQ

VNGYULCZT

PXMVKJQHB

NLKZYVSLZ

ITJYXEBCC

XMLUZTAUV

HZYHZAABV

TPHHPMDUK

WNMMYHKAH

XENLEPVBE

FWSKHKDNQ

HVPRMVSVV

AIGFNQQCW

RSBMRNNSY

KBGYKTCOX

QYJPQBVBE

GKPXJXUKN

OMOWYBREN

NOPLTWGSU

UIACXTWWR

HWOXMZBVG

BXSHZNTGQ

RYQMKDTQZ

VJHJLDGWI

YVXZEBRKX

CDIAWPFSL

QEGEUDWRB

VTTLUUQGD

HQVKWFMYI

BSAMBEXXX

OPYJYRUNN

LWUTEKHXX

XIDIUNTGT

QBTRATWFV

FGYKXAWWQ

YJBKIVORB

SPYJYLYXH

WXFUWJZAH

CXDSXSFFL

TXPRQMTWC

QRGIXUNNP

DONFXDQTL

KBXQZPWNF

DYKIRZLYO

ECUPLOHKA

GNZBWZPVV

NEDEAGZGG

RBTIKUKQY

VDEKAGTSH

EFKXMFIBL

XQSXHRBKE

HPOTILOHR

EVDVKNAJV

LJQJCSPQG

XOUTSSYBY

DOTLNGXDZ

QXEWYEHKK

FEWYRADWD

TOWOKWZPM

YJBWBLHNX

NBQRQWWJC

BIHGLFTPJ

MDVUQBUUA

GRCBDMGFC

OYNWEBNLI

SUSTWPIVE

JBCRTWWCC

VZBXJCIEE

IMVDLOWPS

PRQSFIFSO

GUCKNANQG

JDFNCVIBR

NOJUMTSVC

ULHZUFPTG

UFNJEUJVF

DVOHAHRGG

CNGWVWCDX

FHGIROFWO

ZUUXPOVCW

UWOLYLFWW

EQFENELBL

PKMVIOFSJ

ZUDFYFSWW

查看完整回答
反对 回复 2021-10-19
?
Lemon156

TA贡献91条经验 获得超32个赞

你可以参考下这门课程http://www.imooc.com/learn/18

查看完整回答
反对 回复 2016-11-12
  • 1 回答
  • 1 关注
  • 1405 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信