All,
I'm looking for a way to center and rotate an image in response to a button click. I'm using the jQueryRotate library.
Here is the approach I was considering.
http://jsfiddle.net/HatAndBeard/k3Gxj/6/
This works fine in Chrome/Firefox but not in IE8 or lower. There are some image artifacts that I can't get rid of. Any ideas?
P.S. I don't have strict requirements for how the rotation is done, so other approaches are welcome as well.
P.S.S I can post the code if JSFiddle links aren't to your liking.
It is often referred to as a state of emotional and spiritual equilibrium. It allows you to be accepting of the good and the bad in life and understand that things are always changing, but you can return back to your center to help yourself feel more balanced and grounded when things are difficult.
middle, center, midst indicate something from which two or more other things are (approximately or exactly) equally distant. middle denotes, literally or figuratively, the point or part equidistant from or intermediate between extremes or limits in space or in time: the middle of a road.
Centered and centred are both English terms. In the United States, there is a preference for "centered" over "centred" (99 to 1). In the United Kingdom, there is a 72 to 28 preference for "centred" over "centered".
synonyms: center, core, essence, gist, heart, heart and soul, inwardness, kernel, marrow, meat, nitty-gritty, nub, pith, substance, sum.
I ended up working around the problem by using the BasicImage rotation functionality in IE. I only needed to show the images in 90 degree increments so this approach was workable.
A rough sketch of what I did...
function ieRotate(element, rotation) {
var rotationInt = 0;
switch (rotation % 360) {
case 0:
rotationInt = 0;
break;
case 270:
case -90:
rotationInt = 3;
break;
case 180:
case -180:
rotationInt = 2;
break;
case 90:
case -270:
rotationInt = 1;
break;
}
element.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + rotationInt + ')');
}
Hi im a author of this plugin and I welcome any of comments and issues about this plugin on the homepage of a plugin :)
Can you explain a bit more your problem, as I cant get it to reproduce in IE 8 or IE7 emulated in IE8. Also creating issue would be nice :)
The only "strange" problem that I saw is just a loading image effect that you can easily get rid of if after loading your page you just do a $(img).rotate(0) -> this will make sure that when you click image it will be ready to animate :)
Cheers,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With