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

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

jQuery UI 可拖動滾動速度的單位是什么?

jQuery UI 可拖動滾動速度的單位是什么?

LEATH 2021-12-23 19:04:38
我不明白“100”是什么意思。是每秒 100 像素嗎?此代碼取自:https : //jqueryui.com/draggable/#scroll<!doctype html><html><head>  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">  <link rel="stylesheet" href="/resources/demos/style.css">  <style>   #draggable, #draggable2, #draggable3 { width: 100px; height: 100px; padding: 0.5em; float: left;        margin: 0 10px 10px 0; }  </style>  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>  <script>  $( function() {    $( "#draggable3" ).draggable({ scroll: true, scrollSpeed: 100 });  } );  </script></head><body><div id="draggable3" class="ui-widget-content"> <p>scrollSpeed set to 100</p></div><div style="height: 5000px; width: 1px;"></div></body></html>
查看完整描述

2 回答

?
慕哥6287543

TA貢獻1831條經驗 獲得超10個贊

Jquery scrollSpeed 總是分步確定的。這意味著以相關的 scrollSpeed 每次滾動將是用戶向上或向下移動的像素數。一卷=一步。

例如:100 scrollSpeed 表示每一步是 100px 每 600-800ms。雖然這個衡量標準存在很大差異

scrollSpeed 的度量是一個數字,范圍為 1000(最大)

請記住,scrollSpeed 也主要由最終用戶所在的瀏覽器控制。所以獲得像素/秒是一個艱難的衡量標準,尤其是當用戶輸入隨滾動而變化時。

前任。Chrome 可能與 Safari 不同


查看完整回答
反對 回復 2021-12-23
?
繁花如伊

TA貢獻2012條經驗 獲得超12個贊

scrollSpeed 

Type: Number

Default: 20

The speed at which the window should scroll once the mouse pointer gets within the scrollSensitivity distance. Ignored if the scroll option is false.

Code examples:

Initialize the draggable with the scrollSpeed option specified:


查看完整回答
反對 回復 2021-12-23
  • 2 回答
  • 0 關注
  • 244 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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