It is possible to scroll an iframe by mouse coordinates on mouse move event?
I think what your trying to do is a drag scroll for a div. Check this site out.
This is a demo to a Jquery Plugin that allows you to use mouse down events to drag your scroll area. Simular to that of an Ipod touch or Iphone, but instead of a finger you use your mouse down
http://hitconsultants.com/dragscroll_scrollsync/scrollpane.html
Related
I have a <div> that is a full viewport container, inside the container I have some other divs that I move up or down based on user mousewheel scroll, even if the page never move because it doesn't scroll.
$(window).bind('mousewheel', function(e){
// animate my objects inside viewport
});
on mobile phones and tablet I need to intercept user drag, even if is not really dragging anything, is most like a gesture UP or DOWN
How can I do it?
How can I stop user from using mouse wheel to scroll HTML page?
Normally we use the mouse wheel to scroll page. I the page to keep still even when user triggers the mouse wheel. What should I do?
window.onmousewheel=function(){return false}
http://jsfiddle.net/vBCbP/
I have a container that holds a chart and I wanted to allow the user to click and drag to pan the chart. It works fine until the user drags the mouse outside the container and then the chart is scrolled rapidly in the wrong direction. This seems to be caused by the default scrolling behavior for example if you click and drag in any other element with a scrollbar and drag the mouse out of it, it will begin to scroll.
Is there a way to disable this behavior or some workaround that could make this work?
I only need this to work in chrome (for now at least)
Check out this site. They are using a jQuery plugin dragscrollable, which you can look up or get it from the view source on that page.
How can I achieve to let jQuery/JavaScript perform a jQuery-Function if a mobile-user swipes with one finger to the left an another function if he swipes to the right?
I like to animate scrollLeft and scrollRight to a certain position if the user swipes left/right. I'm doing the same for desktop with keyboard-navigation trough Arrow Left/Right which works perfectly. Now I need the same for swiping on touch devices.
(if possible without jQuery Mobile or another additional library)
ok heres a long answer but it worth it:
jQuery (Swipe vs. Touch) pageX and pageY keep returning 0
Hope it helps
Using some of the following events you can work out which direction a swipe has been made
touchstart: Occurs when a finger is placed on the screen
touchend: Occurs when a finger is removed from the screen
touchmove: Occurs when a finger already placed on the screen is moved across the screen
touchcancel: Occurs when a touch is cancelled before the finger is actually removed from the screen
Record the x,y position on touchstart and again on touchend and determine which direction a swipe has been made
I try to make a gallery that I can move in its content with mouse wheel or with mouse movement.
I used the following script for mouse movement http://valums.com/files/2009/menu/final.htm and for mouse wheel I use Mouse Wheel Plugin.
Separately they work great but when I try to combine them I have some problems. Check the following demo:
http://jsfiddle.net/A93mF/
As you can see partially works but, and I say partially because when I use mouse wheel to scroll it's ok, but when I move a bit the cursor then returns in the previous position.
How can I make it so, if I scroll and then move the cursor to continue normally the scrolling instead of return in the previous position?
Any solution is acceptable (change javascript[jQuery], html structure, plugin or whatever)
I rewrote the mouse movement script and now I think is works fine and in Chrome also (thanks #Nicola Peluchetti ) For anyone interested can check the following demo: http://jsfiddle.net/A93mF/3/