Andy-H Posted January 13, 2012 Share Posted January 13, 2012 $.fn.extend({ slider : function(options) { var settings = { interval : 3000, tag : 'img' }; $.extend(settings, options); this.swap(settings); }, swap : function(options) { if ( this.find(options.tag +':visible').length > 1 ) { this.find(options.tag +':visible').not(':first').hide(); } } }); I have 3 visible images in my $('#slider') element, I am calling $('#slider').slide() from inside $(document).ready(function(){}); yet when I alert this.find(options.tag +':visible').length it alerts 0? Link to comment https://forums.phpfreaks.com/topic/254934-why-isnt-this-working/ Share on other sites More sharing options...
Andy-H Posted January 13, 2012 Author Share Posted January 13, 2012 Never mind, it was treating them as hidden for some reason, I'll find another way. Link to comment https://forums.phpfreaks.com/topic/254934-why-isnt-this-working/#findComment-1307156 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.