With me as the dummy.
I'm a total jQuery newb, and this is my first attempt to use it.
I'm trying to create a fallback for my css3 transitions by using jQuery.animate() inside a vanilla js function. I want to move a series of divs from point A (their current location) to point B (a new location defined inside of an array) like this:
Nothing happens when I click the link that triggers shuffle();. It doesn't even work if I change all the variables to something definite like
I'm pretty sure I've loaded the jQuery library correctly, with:
in the head of my page.
Everything works when I replace the jQuery with my css transitions, so what's going on? The function is in an external js file and I'm testing locally - would those matter?
Much thanks,
~gyz
I'm a total jQuery newb, and this is my first attempt to use it.
I'm trying to create a fallback for my css3 transitions by using jQuery.animate() inside a vanilla js function. I want to move a series of divs from point A (their current location) to point B (a new location defined inside of an array) like this:
Code:
function shuffle(){ i = 0; while(i<=9){ $(document).ready(function(){ $('#div'+i).animate({ top: topArray[i]+'px', marginLeft: leftArray[i]+'px'}, 1500);}); i++; } }
Code:
function shuffle(){ i = 0; while(i<=9){ $(document).ready(function(){ $('#div0').animate({ top:'10px', marginLeft:'100px'}, 1500);}); i++; } }
Code:
<script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script>
Everything works when I replace the jQuery with my css transitions, so what's going on? The function is in an external js file and I'm testing locally - would those matter?
Much thanks,
~gyz
Comment