Posted By

pixelhandler on 07/21/09


Tagged

plugin function onpage


Versions (?)

jQuery plugin - onpage - checks for selector on current page


 / Published in: jQuery
 

function as jquery plugin to test if selector is found on the current page. Sample use:

if ( $("#myID").onpage() ) { $("#myID img").click(function(){ //do this..here.. });

  1. // function as jquery plugin to test if selector is found on the current page
  2. (function($){ $.fn.onpage = function() { return ($(this).length>0) ? true : false } })(jQuery);

Report this snippet  

You need to login to post a comment.