Cría cuervos y te sacarán los ojos

jQuery.slideDown flicker when a form is inside the sliding container

Monday, October 22nd, 2007   by Favio

I prefer long and clear post titles. (^_^)

Having invested more than 8 hours in trying to solve this little problem and, as usual, when I was just going to give up and go with no animation, I came to the realization that I was focusing the first input element of the form right after calling slideDown().

So, I removed that code, checked the documentation and, ta-da!, problem fixed.

Dang

The not-so-cool thing is that I tried a lot of things to make that error go away. Like: removing styles, removing scripts, removing element by element, using javascript calls in links instead of using unobstrusive js, watching tv, playing basketball, using a super basic html file and then adding each component one by one, etc. (a big etc., by the way)

Now, the sad thing is that the animation is not behaving very well on IE7 (works on Opera 9, IE6, FF, Safari for windows).

Wisdom bit

The interesting point here, is learning to think under pressure. The main error was in front of my nose during that precious time. In conclusion, learning to position your head correctly so that the next errors are in front of your eyes, could be a pretty good damn investment.

This entry was posted on Monday, October 22nd, 2007 at 11:36 pm and is filed under Javascript. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 comments to “jQuery.slideDown flicker when a form is inside the sliding container

  • Jonathan said (on March 10th, 2008 at 10:16 am ):

    We just went through the exact same thing :). Finally swapped out “slideDown” with “show”.

    Wish we’d been able to figure it out earlier.

    Ah well, it’s an experience that sticks with you and helps you solve future problems faster.

    Jonathan Wold

  • Favio said (on March 12th, 2008 at 2:34 am ):

    Hello Jonathan,

    well, that time I didn’t had to change the method but instead used a callback. In short, trying to focus an element while animating it, can produce some weird effects. :)

    This is the page I was working on at that time: http://lab.favrik.com/ch/

    Cheers,
    Favio


Leave a Reply





Old and not that old articles

« Trouble with jQuery Ajax load() method

Blog favrik.com version 3! »