problem with rotate function and IE8

139 views
Skip to first unread message

G.Long

unread,
Apr 14, 2011, 5:30:12 AM4/14/11
to jQueryRotate
Hello there =)

I downloaded jQueryRotate 2.1 yesterday. It's very easy to use and the
rotate animation works great on my Firefox 3.6.2, Google Chrome 10 but
it does not work well on IE 8.

Here is my code :

$(document).ready(function(){
$('#myArrow').click(function(){
if ($('#myDiv').is(":hidden")) {
$('#myArrow').rotate({animateTo:0});
$('#myDiv').slideDown("slow");
} else {
$('#myArrow').rotate({animateTo:-90});
$('#myDiv').slideUp("slow");
}
});
});

By default, 'myDiv' is not hidden so myArrow rotate to -90 degrees.
But when I click on myArrow for the second time, the script is not
executed. So I cannot slideDown myDiv anymore. (It is a jQuery
function).

Any idea for this problem?

Thank you :)

G.Long

unread,
Apr 14, 2011, 6:43:57 AM4/14/11
to jQueryRotate
I solved the problem. After looking more carefully at the examples, I
replaced my code with this one:

$("#myArrow").rotate({
bind:
{
click : function() {
if ($('#myDiv').is(":hidden")) {
$(this).rotate({animateTo:0});
$('#myDiv').slideDown("slow");
} else {
$(this).rotate({animateTo:-90});
$('#myDiv').slideUp("slow");
}
}
}
});

Now it works perfectly on Firefox, IE and Chrome :)

Paweł Witkowski

unread,
Apr 14, 2011, 7:26:14 AM4/14/11
to jquery...@googlegroups.com, G.Long
Hi there!

Yea its a problem of rebinding - in IE to have the same effect than in other browsers I have to put image into an object - so all events previously binded to image are lost :)

As you figure out - to solve this problem a "bind" method was introduced :)

Cheers and good luck with the code!

Pawel

2011/4/14 G.Long <jde...@gmail.com>



--
Pawel Witkowski
Senior JavaScript Developer / QML Developer
webpage: http://wilq32.blogspot.com
Reply all
Reply to author
Forward
0 new messages