I am trying to get jQuery to animate with slide rather than toggle. I have these files included in my HTML <head>:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
jQuery:
// $item is a list gathered as $('#gallery ul li') and all output to console as should
// $prev will be used to get current li width, but not to worry about for now.
$.fn.slider = function($item,$prev){
$item.each(function(i){
$(this).animate({width:'slide',left:'-= 500'});
});
};
What I don’t understand is if I change the animate width from slide to toggle, it will work, but with the slide, nothing happens. I tested at jsfiddle, and the slide works there. What’s the deal? What am I missing that jsfiddle has?
Edit: Here is the fiddle: http://jsfiddle.net/robx/ZvKUW/1/
From http://api.jquery.com/animate/
Note that
'slide'isn’t mentioned, therefore it’s ignored.