jQuery - if element hasClass()

0 votes
251 views
added Jan 24, 2019 in jQuery by LC Marshal Captain (25,790 points)
if($(this).hasClass('checked')){
    $(this)
        .animate({ left: -10 })
        .animate({ left: 10 })
        .animate({ left: -10 })
        .animate({ left: 10 })
        .animate({ left: 0 });
}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...