jQuery UI weirdness -
i'm new jquery keen learn. because of i'm using jsfiddle have play , see can done - nothing serious, playing animation, etc.. specifically, ability animate between 2 classes.
getting point, can have @ , let me know why need .delay work?
$('div').click(function() {         if ($(this).hasclass('clicked')) {         $(this).delay(1).removeclass('clicked', 5000, 'easeinelastic');     } else {         $(this).delay(1).addclass('clicked', 5000, 'easeinelastic');     } }); so far can tell, should able rid of 2 .delays, when do, doesn't work.
let's simplify things.
non-animated version (jsfiddle):
$('div').click(function() {     $(this).toggleclass('clicked'); }); correctly animated version (jsfiddle)
 correctly animated version (jsbin)
$('div').click(function() {     $(this).toggleclass('clicked', 5000, 'easeinelastic'); }); the code works on jsbin not jsfiddle - there's wonky jsfiddle. it's not code.
 avoid jsfiddle tooling around jqueryui, since don't play nicely together.
Comments
Post a Comment