当前位置: 首页 > SEO学院SEO知识

背景 #FFF; 溢出 隐藏; 边界 1px虚线#CCC; 高度 100px; 文本对齐 中心; 浮动 离开;

来源:未知 浏览量:167次


我们先来了解一下marquee图片无缝滚动对象的几个的属性:
innerHTML:在对象的开始和结束标记内设置或获取HTML
scrollHeight:获取对象的滚动高度。
scrollLeft:设置或获取对象左边缘与窗口中当前可见内容最左端之间的距离
scrollTop:设置或获取对象最上边缘与窗口中可见内容的最顶层内容之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于布局的高度或父offsetParent属性指定的父坐标
offsetLeft:获取对象相对于布局或offsetParent属性指定的父坐标的计算左侧位置
offsetTop:获取对象相对于布局或offsetTop属性指定的父坐标的计算顶部位置
offsetWidth:获取对象相对于布局的宽度或父offsetParent属性指定的父坐标

sw

一.图片向上无缝滚动

样品生成购买:

< style type='text/css'>
<! -
#demo {
背景: #FFF;
溢出:隐藏;
边界: 1px虚线#CCC;
高度: 100px;
文本对齐:中心;
浮动:离开;
}
#demo img {> 边界: 3px实心#F2F2F2;
显示:块;
}
- >
</style>
向上滚动
< div>
< div>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
</div>
< div></div>
</DIV>

< script>
<! -
Var速度=10; //数字越大百度站长平台


我们先来了解一下marquee图片无缝滚动对象的几个的属性:
innerHTML:在对象的开始和结束标记内设置或获取HTML
scrollHeight:获取对象的滚动高度。
scrollLeft:设置或获取对象左边缘与窗口中当前可见内容最左端之间的距离
scrollTop:设置或获取对象最上边缘与窗口中可见内容的最顶层内容之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于布局的高度或父offsetParent属性指定的父坐标
offsetLeft:获取对象相对于布局或offsetParent属性指定的父坐标的计算左侧位置
offsetTop:获取对象相对于布局或offsetTop属性指定的父坐标的计算顶部位置
offsetWidth:获取对象相对于布局的宽度或父offsetParent属性指定的父坐标

sw

一.图片向上无缝滚动

样品生成购买:

< style type='text/css'>
<! -
#demo {
背景: #FFF;
溢出:隐藏;
边界: 1px虚线#CCC;
高度: 100px;
文本对齐:中心;
浮动:离开;
}
#demo img {> 边界: 3px实心#F2F2F2;
显示:块;
}
- >
</style>
向上滚动
< div>
< div>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
</div>
< div></div>
</DIV>

< script>
<! -
Var速度=10; //数字越大速度越慢
Var tab=document.getElementByIdx_x('demo');
Var tab1=document.getElementByIdx_x('demo1');
Var tab2=document.getElementByIdx_x('demo2');
tab2.innerHTML=tab1.innerHTML; //将demo1克隆到demo2
功能选框(){
If(tab2.offsetTop-tab.scrollTop<=0)//滚动到demo1和demo2的交汇点时
tab.scrollTop-=tab1.offsetHeight //demo跳到顶部
其他{
tab.scrollTop ++
}
}
Var MyMar=setInterval(Marqueespeed);
Tab.onmouseover=function(){clearInterval(MyMar)}; //清除计时器以达到鼠标结束时滚动的目的。
Tab.onmouseout=function(){MyMar=setInterval(MarqueeSEO关键词speed);
Tab.onmouseover=function(){clearInterval(MyMar)}; //清除计时器以达到鼠标结束时滚动的目的。
Tab.onmouseout=function(){MyMar=setInterval(Marqueespeed)}; //移除鼠标时重置计时器
- >
< /脚本>

二.图片向下无缝滚动

示例代码:

< style type='text/css'>
<! -
#demo {
背景: #FFF;
溢出:隐藏;
边界: 1px虚线#CCC;
高度: 100px;
文本对齐:中心;
浮动:离开;
}
#demo img {> 边界: 3px实心#F2F2F2;
显示:块;
}
- >
</style>
向下滚动
< div>
< div>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
< a href='#'>< img src='http://www.cnrui.cn/other/link/Clear_logo.gif'/></a>
</div>
< div></div>
</DIV>

< script>
<! -
Var速度=10; //数字越大速度越慢
Var tab=document.getElementByIdx_x('demo');
Var tab1=document.getElementByIdx_x('demo1');
Var tab2=document.getElementByIdx_x('demo2');
tab2.innerHTML=tab1.innerHTML; //将demo1克隆到demo2
tab.scrollTop=tab.scrollHeight
功能选框(){
如果(tab1.offsetTop-tab.scrollTop>=0)//滚动到demo1和demo2的交汇点时
tab.scrollTop +=tab2.offsetHeight //demo跳到顶部
其他{
tab.scrollTop--
}
}
Var MyMar=setInterval(Marqueespeed);
Tab.onmouseover=function(){clearInterval(MyMar)}; //清除计时器以达到鼠标结束时滚动的目的。
Tab.onmouseout=function(){MyMar=setInterval(Marqueespeed)}; //移除鼠标时重置计时器
- >
< /脚本>

三.图片向左无缝滚动

示例代码:

展开全部内容