mousewheel

Remove HTML scrollbars but allow mousewheel scrolling [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-11-27 17:26:51
Possible Duplicate: How to disable browser or element scrollbar, but allow scrolling with wheel or arrow keys? I was able to disable vertical scrollbars in a grid by setting the CSS property overflow-y: hidden . However, this removed the ability to scroll the contents with the mouse wheel as well. Is there a way to not show the scrollbars but still allow the contents to be scrolled through mouse wheel or arrow keys? There are Javascript methods, see the thread you duplicated. A better solution is to set the target div to overflow:scroll, and wrap it inside a second element that is 8px narrower

JQuery Mousewheel: How to disable?

ぐ巨炮叔叔 提交于 2019-11-27 14:47:47
问题 I am using jquery.mousewheel.js as a part of the jQuery jScrollPane plugin. I want to disable the mousewheel at some point. Could someone please recommend a jQuery statement that can do it? Thank you! 回答1: Something like this: $("#menu").bind("mousewheel", function() { return false; }); 回答2: Try using .unmousewheel() , it should also work. 回答3: the container you must unbind is jspPane In my case i needed to disable it only in the boxes inside #myOuterContainer $('#myOuterContainer .jspPane')

firefox+jquery mousewheel scroll event bug

Deadly 提交于 2019-11-27 14:42:51
问题 UPDATE Working fix as suggested by David (see below): replace $('.scrollMe').bind("mousewheel DOMMouseScroll", ...) with $('.scrollMe').bind("mousewheel DOMMouseScroll MozMousePixelScroll", ...) ORIGINAL POST Firefox 16.0.2 (latest) shows an issue when binding the "mousewheel / DOMMouseScroll" event. Scrolling with the mousewheel while the mouse pointer is on top of my targeted div causes the window to scroll as well- whilst I obviously don't want this. I tried adding several methods to stop

Use jQuery to check mousewheel event without scrollbar

风格不统一 提交于 2019-11-27 13:45:44
How to check mousewheel movement without scrollbar? $(document).mousewheel(function() { clicker.html("a7a"); }); I highly recommend you use this jQuery plugin: PLUGIN Without a plugin, try this example: EXAMPLE HTML: <div id='foo' style='height:300px; width:300px; background-color:red'></div> Javascript: $('#foo').bind('mousewheel', function(e) { if(e.originalEvent.wheelDelta / 120 > 0) { alert('up'); } else { alert('down'); } }); There is no scrollbar on the div but the wheel event is detected. use this code $('#foo').bind('mousewheel DOMMouseScroll', function (event) { if (event

What is the height of a “line” in a wheel event? (deltaMode = DOM_DELTA_LINE)

别说谁变了你拦得住时间么 提交于 2019-11-27 13:27:37
问题 The wheel event in Firefox >= 17 has a deltaMode property. With the OS/mouse I'm using, it's set to 1 (or DOM_DELTA_LINE ). This setting means that the deltaX and deltaY event values are measured in lines and not pixels. Sure enough, if I pretend the deltas are pixels, scroll speeds are much slower than they normally are in Firefox. Chrome 31 by contrast uses a deltaMode of 0 (or DOM_DELTA_PIXEL ), which allows me to simulate scrolling with normal speeds. If I could convert the line values to

Mouse Wheel Event (C#)

懵懂的女人 提交于 2019-11-27 12:42:15
I can't get the Mouse Wheel event in the main form. As a demo I came up with a simple example: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.panel1.MouseWheel += new MouseEventHandler(panel1_MouseWheel); this.panel1.MouseMove += new MouseEventHandler(panel1_MouseWheel); Form2 f2 = new Form2(); f2.Show(this); } private void panel1_MouseWheel(object sender, MouseEventArgs e) { if(e.Delta != 0) Console.Out.WriteLine(e.Delta); } } public partial class Form2 : Form { public Form2() { InitializeComponent(); this.MouseMove += new MouseEventHandler(Form2_MouseMove);

jquery vertical mousewheel smooth scrolling

故事扮演 提交于 2019-11-27 11:55:38
I'm making a parallax website and I would like to make the page scroll smoother with the mousewheel for a better user experience. The best example I could get was this website: http://www.milwaukeepolicenews.com/#menu=home-page It would be great if I could get something similar to that into my website, the smooth vertical scrolling and scroll inertia. I noticed they are using Brandon Aaron's jQuery mousewheel which is very light but I'm just a beginner and cannot make it work by myself. Also i noticed this in their mpd-parallax.js: jQuery(window).mousewheel(function(event, delta, deltaX,

Detecting mousewheel on the x-axis (left and right) with Javascript

浪子不回头ぞ 提交于 2019-11-27 10:56:46
问题 I know it's possible to detect up and down e.g. function handle(delta) { if (delta < 0) { alert('down'); } else { alert('up'); } } function wheel(event){ var delta = 0; if (!event) event = window.event; if (event.wheelDelta) { delta = event.wheelDelta/120; } else if (event.detail) { delta = -event.detail/3; } if (delta) handle(delta); if (event.preventDefault) event.preventDefault(); event.returnValue = false; } /* Initialization code. */ if (window.addEventListener) window.addEventListener(

How do I speed up the scroll speed in a JScrollPane when using the mouse wheel?

无人久伴 提交于 2019-11-27 10:03:44
问题 I see the method JScrollPane.setWheelScrollingEnabled(boolean) to enable or disable the mouse wheel scrolling. Is there any way to adjust the speed of the scrolling, though? It is, in my opinion, ludicrously slow. No matter what size I make the window, the scrolling is about three pixels per click. I'd like it to be much more than that. Any ideas? 回答1: You can try this : myJScrollPane.getVerticalScrollBar().setUnitIncrement(16); 回答2: One way would be to set the unit increment of the scrollbar

How to perform Mouse Wheel scrolling over HTML5 Canvas in Selenium?

早过忘川 提交于 2019-11-27 09:16:52
I am working on a GWT Application (similar to Paint). In this, I have an HTML5 Canvas in which there is a functionality that scrolling a mousewheel up and down will zoom in and out of the canvas. I have searched a lot but didn't find a workaround to fix this issue. Here's what did: int PosX = 0; int PosY = 10; JavascriptExecutor executor = (JavascriptExecutor) getDriver(); String script = "document.getElementById('frontCanvas').scrollBy(" + PosX + "," + PosY + ")"; executor.executeScript(script); WebDriverWait wait = new WebDriverWait(getDriver(), 20); wait.until(ExpectedConditions