Home › Forums › JavaScript › Change function animation duration? › Reply To: Change function animation duration?
December 18, 2013 at 2:14 pm
#158642
Member
Wouldn’t it be like this:
$.fn.extend({
funkOne: function(duration) {
var speed = (duration ? duration : 600);
$(this).animate({ scrollTop: 0 }, speed);
},
funkTwo: function() {
$('div').funkOne(300);
},
funkThree: function() {
$('p').funkOne(900);
}
});
It’s saying that speed is the duration value that gets passed through, but if that doesn’t exist let’s just use 600.