mousewheel

smooth scroll with mousewheel to next or previous div

自作多情 提交于 2019-12-06 06:04:38
问题 I'm trying to get a javascript on my site so when a person scrolls on the website, it automatically scrolls to the next or previous Div with a certain class. I'm working with smoothscroll and scrollto. I also found two codes that I'm trying to combine. But I don't seem to understand the whole scripts... The first script is from http://webdesignerwall.com/tutorials/scrollto-posts-with-jquery. This script makes it possible to navigate between DIV's (with a certain class) by pressing next or

Javascript scrollbar class and mousewheel speed in different browsers

时光怂恿深爱的人放手 提交于 2019-12-06 02:52:38
I'm getting many reports that the mousewheel behaves differently in different browsers when using this scrollbar class. In some browsers (like Firefox) it's extremely slow while in others (mostly newer versions of Safari on Snow Leopard) it's perfect. Any ideas what's going on here and how to fix it? I'm using the Mootools library. One line to pay attention to here is the wheel: (Browser.firefox) ? 20 : 1 line. This is where you set the speed or steps for the mousewheel. Here it is set up in a jsFiddle: http://jsfiddle.net/brandondurham/6SUyM/ var ScrollBar = new Class({ Implements: [Events,

Bind Mouse Wheel To Jquery UI Slider

空扰寡人 提交于 2019-12-05 21:05:30
I did searches and there were a few similar posts but I can't seem to get it to work. I know that its a cliche but I am quite new to JQuery and JQuery UI as my core skills is PHP, so any help is greatly appreciated. Below are the codes that I have for the JQuery vertical slider. $("#VerticalScrollBar").slider({ orientation: "vertical", change: VerticalHandleChange, slide: VerticalHandleSlide, min: -100, max: 0 }); and the functions function VerticalHandleChange(e, ui) { var maxScroll = $(".VerticalScroll").attr("scrollHeight") - $(".VerticalScroll").height(); $(".VerticalScroll").animate({

Chrome - Javascript prevent default Ctrl + MouseWheel behavior

老子叫甜甜 提交于 2019-12-05 13:34:17
I'm trying to prevent the default Ctrl + MouseWheel zoom behavior in Chrome with JavaScript, for the other browsers I use preventDefault() and stopPropagation() in the callback function for mouse-wheel event and works perfect because the other browser always trigger a mouse-wheel event but Chrome does not. Reading the question How to catch Zoom event with GWT and Chrome I found that Ctrl + MouseWheel can be caught as a resize event but after zooming the page so I can't prevent the behavior with this one. Is there other event created before Ctrl + MouseWheel in Chrome or is a bug? Rob W

How to implement MouseWheelListener for JPanel without breaking its default implementation?

淺唱寂寞╮ 提交于 2019-12-05 11:20:52
Simply; I have a JPanel inside a JScrollPane ; As expected; JScrollPane by default listens to MouseWheelEvent so that scrolling is working well for when the wheel is rotating and while the cursor is hovering over the JPanel . But After that; I just updated JPanel so that it implements MouseWheelListener , and I added this mouse wheel listener for the JPanel itself. @Override public void mouseWheelMoved(MouseWheelEvent e) { if (e.isControlDown()) { if (e.getWheelRotation() < 0) { System.out.println("mouse wheel Up"); } else { System.out.println("mouse wheel Down"); } } } The JPanel responds to

Limit 'mousewheel' delta to fire once per scroll

只谈情不闲聊 提交于 2019-12-05 06:57:47
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/lyonandlyon/ Thanks in advance, R Animation functions for reference: var prevProject = function() { // up

HTML content only scrolls with scrollbar, not mouse wheel

陌路散爱 提交于 2019-12-05 06:24:35
I have a <div> on my page with a fixed height, and overflow-y: scroll; set so that the content will scroll when it passes the bottom edge of the <div> . Nothing out of the ordinary. For some bizarre reason, the mouse wheel will only scroll the content if the cursor is over empty space in the <div> or if it's over the scrollbar itself. If the cursor happens to be over any of the text content in the <div> , the mouse wheel won't do anything. This happens in both Firefox and Chrome, so it isn't just a quirk of a particular rendering engine or something. The <div> in question is overlaid on top of

Jquery mouse wheel horizontal scrolling with trackpad

北城余情 提交于 2019-12-05 06:16:21
问题 I am using the jquery.mousewheel.js plugin (Github) to build a horizontal scrolling website. It works so far, but I am not able to figure out one problem: If I am using a trackpad (e.g. on a MacBook Pro) and scroll horizontally with two fingers, depending on how parallel the fingers are positioned, the site will stuck or is confused in which direction it should scroll. Is there a way to make this horizontal scroll also working smooth? This is the code I use in the head part: $(function () { $

Mouse wheel not working when over ScrollViewer's child controls

我的梦境 提交于 2019-12-05 03:34:31
I was kind of expecting my ScrollViewer's child controls to hand the MouseWheel events back up the the ScrollViewer automatically, and that's not the case. I have a ScrollViewer with a ListBox in it. If I manually resize the width of the ListBox to be less than the ScrollViewer, the MouseWheel works on all of the ScrollViewer but has no effect when the mouse is positioned above the ListBox. What's the standard way to do this? Do I put an event trigger on the ListBox that fires the event on the parent? Do I handle and reroute the event in the code behind? Kent Boogaart The ListBox 's template

Delphi 7 - Handling MouseWheel events for Embedded Frames in Forms?

别等时光非礼了梦想. 提交于 2019-12-04 22:19:59
问题 Hi I have a form with several frames inside. For some of the frames, i wish to scroll the contents (or at least handle the mousewheel event). I have tried the following: Simply assigning a OnMouseWheel event handler for each frame Overriding the MouseWheel event for the parent form: procedure TFmReview.MouseWheelHandler(var Message: TMessage); var Control: TControl; begin Control := ControlAtPos(ScreenToClient(SmallPointToPoint(TWMMouseWheel(Message).Pos)), False, True); if Assigned(Control)