JQuery :: Animation ScrollTop Is Not Slow / What To Do?
Dec 6, 2011
I have following code to have a scroll animation effect. The cod eis triggered e.g. by a click.[code]...
The problem is, that the browser (tested in FF, Chrome, IE9) just jumps to the scroll target, no effect is viewable. I googled the code in different places, everybody else seems to have no probs with it.
I have a button which is animated with a rollover effect, obtained through jQuery of course. I wish to open a lightbox clicking that button and I tried with a simple, self-made lightbox and with FancyBox but in either case the lightbox is displayed without animation.I post the code for my buttons and the lightboxHTML for buttons:
I am migrating a site from prototype/scriptaculous to jQuery, and I am encountering a lot of problems with animations in IE. I should start by asking that in scriptaculous, none of these animations require special CSS or tricks for IE (like getting rid of position absolute or anything like that), but this seems to be the case for almost every animation I do in jQuery - is there a list somewhere of all the little hacks and tricks people need to do to get these animations to work in IE? I have re-implemented a few hundred of these animations (mostly crossfades, sliding up and down, highlights), and not a single one worked in IE with the original CSS from the scriptaculous version (in most cases, the other browsers would). In most cases this has to do with absolute positioning. Is it possible jQuery 1.4.4 (the version I am working with) just has massive problems or something because my impression was this library was supposed to be easier to work with, not inordinately more difficult... I just find it hard to believe everyone else is having this many issues with it.
In any event, one thing I can't find any fix for anywhere, is animating the scrollTop of an element (NOT the whole page, which seems to be what everyone else wants to do). I have a div with overflow:hidden, and two buttons underneath which allow the user to scroll through the div (a real scrollbar in this context would not look good or be very useful in comparison).
I ported the code over from scriptaculous, and it works just fine in all normal browsers. Here is the version that would animate scrolling up:
Tested in Firefox/Chrome/Safari just fine right off the bat. But in IE, it just waits and then calls my callback, setting the scrollTop correctly at the end but not actually animating. It's not totally failing, in the sense that the scrolling does happen, and the callback does fire, but it should animate, and I don't really see any reason why it wouldn't. I have set position on the div and all wrapping divs to relative, and static, and set the display value, set the zoom value, widths, heights, everything, but this div will not animate as it scrolls at all in IE only (this is all IE's - 6, 7, and 8). I also tried isolating the div on its own page, removing nearly all the content (leaving text so it will have something to scroll through), practically no CSS outside of width, height, and overflow, and again - does not work in IE only (works in all other browsers without fail).
So im basically using a link, to scroll through a series of divs to select the correct one.Ie click on happy, and scrolls to 'happy' div, However, the scroll seems to not go to what its linked to, but scrolls to the third div in the list.
Now, when I remove 'overflow: hidden' from the body element, the scrolling does work in chrome, but of course adds the scrollbars which I don't want.
I don't know if this is a browser bug. I positioned a div at the bottom of the page just underneath the viewport, calculating it with $(document).height() and animate it to bottom:0, works great even when scrolling, cause of updating with the scroll-event. But when I reload this page or scroll down a bit the original position value was used, so it animates to the original viewport value.
I've been messing with this code to make a fade in animation with setTimout. The only thing is addition isn't working on the fade in. A subtraction on a negative works though. This seems strange to me.
changeit.style.opacity -= -0.01; works but when it's changed to changeit.style.opacity += 0.01; there's no fade in. It's the only thing I change. My intuition says to me it should work with addition, but maybe there's something I'm not understanding.
changeit.style.opacity -= -0.01; if this is set to changeit.style.opacity += 0.01; it doesn't work. What?
Of course this is all just for Firefox for now. If I put this in something useful I'll change it so it'll work in other browsers later.
In the following (IE only) mini page (a table which is supposed to have a fixed header), when you first do anything with the scroll bar, you will see the top two rows of the table jump slightly (a few pixels) down and to the right. I could figure out a specific numeric fudge factor value that will make me happy on my own Win 2K / IE 6 system, but I'd like to know a proper way to make this more general (for other IEs). Code:
I have a problem with the jQuery.ajax() function combined with a keyup event (i think key events in general). I'm binding an keyup event to an input field so that on every change the current input is send via the ajax function and receives new data from the server, displaying it in a selectbox.
when I'm typing very fast it seems that the ajax function is too slow for this and shows up old result elements. After triggering the event another time, e.g. via UP,DOWN,.. it receives and displays the correct data.
Please the link to see what I have done so far...[URL]... It is a day planner, where various places can be dragged on to the day planner. It works, but it seems very slow. Running firebug profile when dragging a simle place into a single slot tells me that over 35,000 calls were made.