Difference between event.preventDefault() and return false

preventDefault() prevents the default event from occuring, stopPropagation() prevents the event from bubbling up and return false does the both. Example of preventDefault() and return false: $(‘a’).click(function() { return false; }); $(‘a’).click(function(e) { e.preventDefault(); }); So finally, return false from within a jQuery event handler is effectively same as calling both e.preventDefault and e.stopPropagation on […]

Disable text selection highlighting using CSS rule

There is a CSS standard way by which you can disable the highlighting effect i.e. disable text selection when you select any text. This can be done using JavaScript but using CSS you can achieve this also. <style type=”text/css”> .disableselect { user-select: none; -ms-user-select: none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; } </style> […]

SlidesJS, a jQuery responsive slideshow plug-in

SlidesJS is a jQuery responsive slideshow plug-in for version 1.7.1+ with various features like responsive, CSS3 transition. It has the following features: Responsive CSS3 transitions Touch effect Easy setup Options width (number) & height (number) start (number) navigation (object) pagination (object) play (object) effect (object) callback (function) Here is a simple example: <!doctype html> <head> […]