手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >基于javascript滚动图片具体实现
基于javascript滚动图片具体实现
摘要:前台:复制代码代码如下:服务展示javascript:复制代码代码如下:varspeed=12;//数字越大速度越慢vartab=docum...

基于javascript滚动图片具体实现1

前台:

复制代码 代码如下:

<div>

<div>

<strong>服务展示 </strong>

</div>

<div id="showroom">

<div>

<div id="index_foot_slide">

<div id="in_index_foot_slide">

<div id="index_foot_slide1">

<asp:Repeater ID="repBottomPictures" runat="server">

<ItemTemplate>

<a href="">

<img src='<%#Eval("ImageUrl")%>' /></a>

</ItemTemplate>

</asp:Repeater>

</div>

<div id="index_foot_slide2">

<asp:Repeater ID="Repeater1" runat="server">

<ItemTemplate>

<div>

<a href="">

<img src='<%#Eval("ImageUrl")%>' /></a></div>

</ItemTemplate>

</asp:Repeater>

</div>

</div>

</div>

</div>

</div>

</div>

javascript:

复制代码 代码如下:

var speed=12; //数字越大速度越慢

var tab=document.getElementById("index_foot_slide");

var tab1=document.getElementById("index_foot_slide1");

var tab2=document.getElementById("index_foot_slide2");

tab2.innerHTML=tab1.innerHTML;

function Marquee(){

if(tab.scrollLeft<=0)

tab.scrollLeft+=tab2.offsetWidth

else{

tab.scrollLeft--

}

}

var MyMar=setInterval(Marquee,speed);

tab.onmouseover=function() {clearInterval(MyMar)};

tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};

【基于javascript滚动图片具体实现】相关文章:

基于javascript简单实现对身份证校验

javascript实现树形菜单的方法

javascript转换静态图片,增加粒子动画效果

javascript动态设置样式style实例分析

javascript实现图片跟随鼠标移动效果的方法

JavaScript静态的动态

Javascript节点关系实例分析

javascript常用方法总结

谈一谈javascript闭包

javascript中this的四种用法

精品推荐
分类导航