Create jQuery chaining with customized conditional control by filter
and end
that are built-in methods of jQuery.
This trick can simplify you JavaScript codes to a single chain and can be maintained
more easliy.
All conditions and each corresponding action are put together into a singal
line. If you wanna disable one of contition controls. Just comment that line.
1 | $('.your_selector') |