基于爪哇岛描述语言实现图片左右切换效果
本文实例介绍了爪哇岛描述语言实现图片左右切换效果的详细代码,分享给大家供大家参考,具体内容如下
效果图:
具体代码:
超文本标记语言标题射流研究…图片左右切换效果/title meta charset=' utf-8 '/style type=' text/CSS ' * { margin 33600;划水:0;} .图像-滚动{ border:1px固体# CCCmargin:100px auto宽度宽度:300像素高度:200 px位置:相对;} .图像-滚动ul {列表式:无;} .图像-滚动Li { float : leftisplay : none }。图像-滚动。活动{ display:block}。图像-滚动{ a } .图像-滚动img { width:300px高度:200 pxborder:none}。图像-滚动。左滚动{ position : absolutetop :40%;左侧:-40px;opa city 33600 background : URL(' images/BG _ direction _ nav。png ');背景-重复:不重复;背景-位置:0 px 0px高度:27 px宽度:27 px光标:指针指针;} .图像-滚动。右滚动{ position : absolutetop :40%;opa city 33600 right :-40px;背景: URL(' images/BG _ direction _ nav。png ');背景-重复:不重复;背景-位置:-30px 0px;高度:27 px光标:指针指针;宽度:27 px} .图像-滚动右键滚动:悬停{背景色:透明;}/style脚本src=' http : jquery-1。8 .2 .js '/script/head body div id=' images-scroll ' class=' images-scroll ' ul Li class=' active ' a href=' img src=' http : images/1。jpg ' alt=' '/a/Li lia href=' ' img src=' http : images/2。jpg ' alt=' '/a/Li lia href=' ' img src='鼠标悬停(function(){ $(' #左滚动')).animate({left: '10px ',opacity: ' 1 ',},400);$(' #右滚动')。animate({right: '10px ',opacity: ' 1 ',},400);})$(' # images-roll ').鼠标离开(函数(){ $(' #左滚动')).animate({left: '-40px ',opacity: ' 0 ',},400);$(' #右滚动')。animate({right: '-40px ',opacity: ' 0 ',},400);})imgScroll=setInterval(' runScroll()',3000);var last _ idx=$(' # images-roll ul Li ').索引($(' # images-roll ul Li : last ');函数运行scroll(){ var idx=$(' # images-scroll ul Li ').索引($(' # images-roll ul .active’)[0]);$(' # images-roll Li ').情商.removeClass("活动")。hide();idx=1;if(idx %(last _ idx 1)=0){ idx=0;} $(' # images-roll Li ').情商.addClass('active ').show();} $(' #左滚动')。单击(function(){ var idx=$(' # images-scroll ul Li ').索引($(' # images-roll ul .active’)[0]);$(' # images-roll Li ').情商.removeClass("活动")。hide();idx-=1;if(idx==-1){ idx=last _ idx;} $(' # images-roll Li ').情商.addClass('active ').show();})$("#右滚")。click(function(){ runScroll();})/脚本/正文/html以上就是本文的全部内容,希望对大家学习爪哇岛描述语言程序设计有所帮助。
版权声明:基于爪哇岛描述语言实现图片左右切换效果是由宝哥软件园云端程序自动收集整理而来。如果本文侵犯了你的权益,请联系本站底部QQ或者邮箱删除。