我可以讓jscrollpne這樣,即使當子滾動達到其底部時,父窗格也不滾動。現在當孩子滾動達到父母的底部滾動發生。我只希望父級在鼠標移出子滾動條時滾動。jscrollpane塊滾動父母
6
A
回答
4
$('.selector').mousewheel(function(event) {
event.preventDefault();
});
5
您所描述的行爲是設計使然。這是本機瀏覽器滾動條在具有溢出的元素上的行爲方式:auto。我不會建議改變它。但是,如果你想那麼Borgenk的答案是正確的,你可以使用此代碼:
$('.scroll-pane')
.jScrollPane()
.bind(
'mousewheel',
function(e)
{
e.preventDefault();
}
);
在這裏看到一個例子(您可能需要收縮你的窗口,使家長有任何需要滾動):http://jsfiddle.net/VYcDZ/51/
1
就遇到了這個問題,今晚......看見沒有人知道答案,所以我寫了起來
var blockScrollTarget;
$('.jscroll').mousewheel(blockScroll);
......
function blockScroll(e) {
blockScrollTarget = blockScrollTarget || $(e.currentTarget);
var d = blockScrollTarget.data('jsp');
if(d.getPercentScrolledY() == 1 || d.getPercentScrolledY() == 0) {
return true;
}
if(d.getIsScrollableV()) {
e.preventDefault();
}
}
0
以上回答對我沒有工作。如果您熟悉編輯插件的源,你可以公開相關的內部方法的公共API:
// Public API
$.extend(
jsp,
{
...
initMousewheel : function(){
initMousewheel();
},
removeMousewheel : function(){
removeMousewheel();
}
}
);
現在,您可以有條件地和務實eanable /禁用任何JScrollPane中的滾動:
api = $('#full-page-container').data('jsp');
api.removeMousewheel(); // disable
api.initMousewheel(); // enable
相關問題
- 1. 的JTextPane防止在父滾動JScrollPane的
- 2. jscrollpane滾動面板
- 3. 智能JScrollPane自動滾動
- 4. 禁用MDI中的滾動條父母
- 5. 不可滾動的RecyclerView與可滾動父母
- 6. 使用jScrollPane,拖動塊不會去滾動條的底部
- 7. jscrollpane垂直滾動條
- 8. JScrollPane左側滾動條
- 9. jScrollPane滾動條問題
- 10. jQuery jScrollPane同步滾動
- 11. 滾動的JLabel在JScrollPane中
- 12. JScrollPane的和JTextArea的滾動
- 13. jScrollPane - 超薄滾動條
- 14. JScrollpane:僅通過unitIncrement滾動
- 15. jScrollPane horyzontal滾動條頂部
- 16. 滾動的JComponent在JScrollPane中
- 17. JScrollpane不滾動大內容
- 18. JScrollPane在JTextArea中不滾動
- 19. 使用jScrollPane回滾滾動位置
- 20. 在拖動JScrollPane上的JLabel的同時滾動JScrollPane
- 21. 使用祖父母塊
- 22. jscrollpane自動滾動文檔加載?
- 23. 將JScrollPane滾動向右移動SWING
- 24. JScrollPane的和JList的自動滾動
- 25. JScrollPane - 自動滾動到底部?
- 26. 滾動IFRAME父
- 27. 父母的父母的父母
- 28. 在JScrollPane上設置滾動條
- 29. JScrollpane不會樣式滾動條
- 30. JScrollPane不工作/顯示滾動條
不介意自己知道這個答案。 – Atorian 2011-01-15 16:12:40