views:

19

answers:

1

For a site I'm building, I import my Jquery code from...

http://jqueryjs.googlecode.com/files/jquery-1.3.2.js

...but when I run the site in IE, it gives me various instances of "argument not valid" on line 4031.

This happens when I hover above a field which should be animated on trough Jquery. Here is the JS code I wrote...

$('body ul li').each(
        function(){
            var tamcompleto = $(this).css('height');
            $(this).hover(
                function(){
                    $(this).stop().animate({height:tamcompleto},{queue:false, duration:600, easing: 'easeOutBounce'});
                },
                function(){
                    $(this).stop().animate({height:'50px'},{queue:false, duration:600, easing: 'easeOutBounce'});
                }
            );
            $(this).css('height','50px');
        }
    );

Is this a case of incompatibility? Or is my code wrong?

Also, I've tried height:'auto' instead of height:'tamcompleto' on the hover function, but it doesn't work, Isn't height:'auto' supposed to be the right way to do it?

+1  A: 

If the element doesn't have a height specified, css('height') won't return anything. You can use the height function instead, which gives you the actual height in pixels:

var tamcompleto = $(this).height() + 'px';
Guffa
Thank you very much. On IE the dots for the <li> still show up, is there a way to get rid of them?
serv-bot 22
@serv-bot: have a look at the *list-style* css property or ask a separate question.
Georg