Posted By

arpit on 09/30/09


Tagged

jquery selector


Versions (?)

Create custom jQuery selector


 / Published in: JavaScript
 

URL: http://www.tvidesign.co.uk/blog/improve-your-jquery-25-excellent-tips.aspx#tip15

  1. $.extend($.expr[':'], {
  2. over100pixels: function(a) {
  3. return $(a).height() > 100;
  4. }
  5. });
  6.  
  7. $('.box:over100pixels').click(function() {
  8. alert('The element you clicked is over 100 pixels high');
  9. });

Report this snippet  

You need to login to post a comment.