下拉菜单问题。二级菜单最后一个超出了,我希望鼠标放上去的时候能够自右向左滚动,js代码怎么实现
2个回答
展开全部
<script type="text/javascript">
var speed = 25;
//demo2.innerHTML = demo1.innerHTML;
function Marquee() {
if(demo.scrollLeft>=demo.clientWidth ){
demo.scrollLeft=0;
}
else{
demo.scrollLeft++;
document.getElementById("sl").value=demo.scrollLeft;
document.getElementById("sw").value=demo.clientWidth;
}
}
var MyMar = setInterval(Marquee, speed);
demo.onmouseover = function () { clearInterval(MyMar) };
demo.onmouseout = function () { MyMar = setInterval(Marquee, speed) };
</script>
var speed = 25;
//demo2.innerHTML = demo1.innerHTML;
function Marquee() {
if(demo.scrollLeft>=demo.clientWidth ){
demo.scrollLeft=0;
}
else{
demo.scrollLeft++;
document.getElementById("sl").value=demo.scrollLeft;
document.getElementById("sw").value=demo.clientWidth;
}
}
var MyMar = setInterval(Marquee, speed);
demo.onmouseover = function () { clearInterval(MyMar) };
demo.onmouseout = function () { MyMar = setInterval(Marquee, speed) };
</script>
追问
没看懂 你能用ul li做个例子吗
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询