mousewheel

scroll to next divs on mousewheel jQuery

亡梦爱人 提交于 2020-01-13 05:14:10
问题 Trying to create a parallax page and on each mousewheel, page would scroll to next div (block) I tried with the following code but no luck, can anyone please suggest. Here is the working JSFiddle demo, (I have added mousewheel plugin as well) $(document).ready(function() { $('section').css({ 'height': (($(window).height())) + 'px' }); // Now bind the event to the desired element $('section').bind('mousewheel', function(e) { if (e.wheelDelta / 120 > 0) { $(this).text('scrolling up !'); } else

How to zoom at a point in picturebox

寵の児 提交于 2020-01-11 09:28:29
问题 This is my code. I am able to zoom the picturebox but not at a point. How to zoom to a mouse point when i rotate the mouse wheel? The variables are:- private double m_dZoomscale = 1.0; //THIS IS THE ZOOM SCALE TO WHICH EACH OBJECT //ARE ZOOMED IN THE CANVAS public static double s_dScrollValue = .01; //scale factor value for mouse scroll zooming The paint code is:- private void m_Picturebox_Canvas_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; g.ScaleTransform((float)m

Use jQuery to check mousewheel event without scrollbar

空扰寡人 提交于 2020-01-09 04:58:05
问题 How to check mousewheel movement without scrollbar? $(document).mousewheel(function() { clicker.html("a7a"); }); 回答1: 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

Child elements of scrollviewer preventing scrolling with mouse wheel?

六月ゝ 毕业季﹏ 提交于 2020-01-09 04:38:08
问题 I'm having a problem getting mouse wheel scrolling to work in the following XAML, which I have simplified for clarity: <ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" CanContentScroll="False" > <Grid MouseDown="Editor_MouseDown" MouseUp="Editor_MouseUp" MouseMove="Editor_MouseMove" Focusable="False" > <Grid.Resources> <DataTemplate DataType="{x:Type local:DataFieldModel}" > <Grid Margin="0,2,2,2" > <TextBox Cursor="IBeam" MouseDown="TextBox

Javascript (or some other lang) to detect the wheel direction without using pageYOffset

随声附和 提交于 2020-01-06 03:38:29
问题 I have a page not higher than the window => it has no scroller. How can I detect the direction, in which the wheel is rolled? And if JavaScript can't handle this, is there some other net language to help my case? Thanks 回答1: It's given to you wholesale on the MDN page for "wheel" events, reproduced below: (function(window,document) { var prefix = "", _addEventListener, onwheel, support; // detect event model if ( window.addEventListener ) { _addEventListener = "addEventListener"; } else {

MouseWheel event doesn't fire in SWT-AWT component

◇◆丶佛笑我妖孽 提交于 2020-01-04 13:06:56
问题 I am stuck at mousewheel event that just doesn't fire. I use swt_awt bridge, so I am able to use swing component in my RCP application. I tested everything I was able to find, but with no success. Because my application is awfully complex, I created a simplified version of my problem, which should also help you to orientate if you would like to help me. Now this simplified problem is, that I want my textarea (or scrollpane) to catch mousewheel events. But these events are lost. import java

MouseWheel event doesn't fire in SWT-AWT component

徘徊边缘 提交于 2020-01-04 13:06:41
问题 I am stuck at mousewheel event that just doesn't fire. I use swt_awt bridge, so I am able to use swing component in my RCP application. I tested everything I was able to find, but with no success. Because my application is awfully complex, I created a simplified version of my problem, which should also help you to orientate if you would like to help me. Now this simplified problem is, that I want my textarea (or scrollpane) to catch mousewheel events. But these events are lost. import java

MouseWheel Event With Picturebox?

随声附和 提交于 2020-01-02 05:06:25
问题 I want to hover over a picturebox (or all pics and the main form) and use the mousewheel to scroll. However i have no luck. I wrote pictureBox1.MouseWheel and check the delta. I set a breakpoint for when it != 0. So far no matter what i did i couldnt get anything to happen. I tried mousemove as well and that didnt work. However breaking on the if statement works. I just can never get the wheel to work. How do i make picturebox (or any control in the form) call a mousewheel event? -edit-

Limit 'mousewheel' delta to fire once per scroll

情到浓时终转凉″ 提交于 2020-01-02 03:41:05
问题 I'm using the following code below, to scroll two divs in different directions () but I'm curious to know if you can limit the scroll so it only fires once per scroll (rather than it continually scrolling and sending my functions into an endless loop. $('.page-left, .page-right').bind('mousewheel', function(event, delta) { var windowHeight = $(window).height(); if (delta < 0) { prevProject(); } if (delta > 0) { nextProject(); } }); You can see where I'm up up to here: http://dev.rdck.co

jquery mousewheel plugin: how to fire only one function every scroll

馋奶兔 提交于 2020-01-01 14:21:04
问题 i'm using a moushweel plugin because i want my user to fire an action everytime it scroll up or down, but i dont want to have multiples fires (if you have a apple magic Mouse it is even worse because is too sensitive) any idea on how to prevent it? this is the code jQuery(function($) { $('div.mousewheel_example') .bind('mousewheel', function(event, delta) { var dir = delta > 0 ? 'Up' : 'Down', vel = Math.abs(delta); $(this).text(dir + ' at a velocity of ' + vel); return false; }); }); this is