wilq32-pwitkowski / jqueryrotate

jQueryRotate - plugin to rotate images by any angle cross-browse with animation support
http://jqueryrotate.com
151 stars 58 forks source link

Don't work with variables, just static numbers. #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. <script>$("#div_id").rotate(<?=$angle?>);</script>
2. HTML input box with event onchange='$("#div_id").rotate(this.value)'
3. <input type="text" name="angle" id="angle" 
onchange="$("#div_id").rotate(this.value)" />

What is the expected output? What do you see instead?
I expected to see rotated object. Instead I saw nothing.

What version of the product are you using? On what operating system?
2.0 jqueryRotate. Google Chrome 10.0.648.133. Windows 7.

Please provide any additional information below.
I'm using jQuery Draggable on same div layer.

Also I tried
HTML input box with event onchange='$("#div_id").rotate(25)' <- That WORKS!
I also tried onchange='alert(this.value)' and it shows the correct values.

Original issue reported on code.google.com by ad...@sok4e.eu on 15 Mar 2011 at 10:31

GoogleCodeExporter commented 9 years ago
Well its definitelly works with variables (I've tested that many times). Its 
broken for you because you have double quotes used twice:

onchange="$("#div_id").rotate(this.value)"

This means that onchange function ends at the end of first brace ;)

Hopefully this helps you solve problem :)

Original comment by wil...@gmail.com on 15 Mar 2011 at 10:40

GoogleCodeExporter commented 9 years ago

Original comment by wil...@gmail.com on 15 Mar 2011 at 10:41

GoogleCodeExporter commented 9 years ago
Yeah I solve it that way:

$('#np_angle').change(
function()
 {
$('#np_drag').rotate(parseInt($('#np_angle').val()));
 });

Nothing else helped.

Original comment by ad...@sok4e.eu on 17 Mar 2011 at 5:32

GoogleCodeExporter commented 9 years ago
parseInt() did the trick for me.  Thank you!

Original comment by bignat...@gmail.com on 19 May 2011 at 6:45