[jQuery] Re: Very Small Script Not Working in IE 7
Hi, You have a trailing comma at the end of the parameter for the animate commands - it's not needed. I think IE treats it as invalid JS so ignores the command. So try it like this: $(.sidebar a).mouseover(function(){ $(this).animate({ marginLeft: 10px }, 400 ); }); Paul On Mar 16, 7:12 am, DLee dan.b@gmail.com wrote: Hi guys. I had recently asked for help regarding a script that animated some text. Nothing serious. It works great in all versions of FF, but does not work in IE 7. Any suggestions will be greatly appreciated. My DOCTYPE: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; The JQuery: $(document).ready(function(){ // Using multiple unit types within one animation. $(.sidebar a).mouseover(function(){ $(this).animate({ marginLeft: 10px, }, 400 );}); $(.sidebar a).mouseout(function(){ $(this).animate({ marginLeft: 0px, }, 400 ); }); });
[jQuery] Re: Very Small Script Not Working in IE 7
That works great guys. Thanks a heap! On Mar 16, 9:29 am, errant d.cheka...@gmail.com wrote: Hi. First, make sure events are attached to elements and firing ( $ (.sidebar a).mouseover(function(){ alert(this) }; or smth like this). Second, there are nice method called hover:http://docs.jquery.com/Events/hover#overoutwhich combines mouseover and mouseout. On 16 мар, 10:12, DLee dan.b@gmail.com wrote: Hi guys. I had recently asked for help regarding a script that animated some text. Nothing serious. It works great in all versions of FF, but does not work in IE 7. Any suggestions will be greatly appreciated. My DOCTYPE: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; The JQuery: $(document).ready(function(){ // Using multiple unit types within one animation. $(.sidebar a).mouseover(function(){ $(this).animate({ marginLeft: 10px, }, 400 );}); $(.sidebar a).mouseout(function(){ $(this).animate({ marginLeft: 0px, }, 400 ); }); });