Reputation: 27
I'm sitting here now for about three hours trying to make a simple Animation with JSTween. I found a few threads where I got examples for what I'm trying to do (for Example this) but it just doesn't work. For sure it's just some "when you see it" failure. Would be nice if one of you would have a look on the code.
<body>
<ul id="slides">
<li id="left">
</li>
<li id="center">
</li>
<li id="right">
</li>
</ul>
</body>
$(window).load(function(){
var left = $('#left'),
center = $('#center'),
right = $('#right');
center.click(function(){
left.tween({
left:{
start: -500,
stop: 0,
time: 0,
duration: 3,
units: 'px',
effect: 'easeInOut'
}
});
$.play();
});
});
Thanks Spyrko
Upvotes: 0
Views: 153
Reputation: 30565
Instead of using:
$(window).load(function(){
Use:
$(document).ready(function(){
I amended your JSFiddle and it works fine: http://jsfiddle.net/7t5La/3/
Upvotes: 1