亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用鼠標懸停從左到右、從右到左滾動

使用鼠標懸停從左到右、從右到左滾動

犯罪嫌疑人X 2023-09-25 16:17:33
我嘗試使用 jQuery (jquery-1.7.1.min.js) 滾動,mouseover但無法滾動。下面是我的代碼。var ele = $('html,body');var speed = 1,  scroll = 3,  scrolling;$('#up').mouseenter(function() {  //scroll the element up  scrolling = window.setInterval(function() {    ele.scrollTop(ele.scrollTop() - scroll);  }, speed);});$('#down').mouseenter(function() {  //scroll the element down  scrolling = window.setInterval(function() {    ele.scrollTop(ele.scrollTop() + scroll);  }, speed);});$('#up, #down').bind({  click: function(e) {    //stop scrolling    if (scrolling) {      //prevents the default click action      e.preventDefault();    }  },  mouseleave: function() {    if (scrolling) {      window.clearInterval(scrolling);      scrolling = false;    }  }});.control {  width: 100%;  position: fixed;  text-align: center}#up.control {  position: fixed;  top: 0}#down.control {  position: fixed;  top: 20}/* no needed: */#scroll {  overflow-x: scroll;  width: 500px;  white-space: nowrap;  overflow: hidden!imprtant;}onmouse左側和右側需要從左到右和從左到右滾動文本,但它無法使用 jQuery。
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關注
  • 119 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號