Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery ui 如何在jqueymobile web应用程序中删除滚动条?_Jquery Ui_Scrollbar_Jquery Mobile - Fatal编程技术网

Jquery ui 如何在jqueymobile web应用程序中删除滚动条?

Jquery ui 如何在jqueymobile web应用程序中删除滚动条?,jquery-ui,scrollbar,jquery-mobile,Jquery Ui,Scrollbar,Jquery Mobile,我正在使用jQueryMobile alpha3开发一个移动web应用程序。在这种情况下,即使控件在屏幕内,我也会在每页中获得滚动条 我想要滚动条只有当控件离开屏幕,否则我必须删除滚动条。如何设置?有没有办法指定 有一段时间我也遇到过这种情况,问题是某些元素的溢出。您可以通过使用滚动条将CSS规则应用于任何元素来修复它。所以,像这样的事情 .ui-content{ overflow:hidden; } 试试看 CSS jquery $("div").bind("mousewheel",

我正在使用jQueryMobile alpha3开发一个移动web应用程序。在这种情况下,即使控件在屏幕内,我也会在每页中获得滚动条


我想要滚动条只有当控件离开屏幕,否则我必须删除滚动条。如何设置?有没有办法指定

有一段时间我也遇到过这种情况,问题是某些元素的溢出。您可以通过使用滚动条将CSS规则应用于任何元素来修复它。所以,像这样的事情

.ui-content{
    overflow:hidden;
}
试试看

CSS

jquery

$("div").bind("mousewheel",function(ev, delta) {
    var scrollTop = $(this).scrollTop();
    $(this).scrollTop(scrollTop-Math.round(delta * 20));
});
图书馆

(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);

请链接到工作代码。您可能必须修复位于页脚中的某些内容,或者它是您的自定义样式。
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);