[Plugin: Tabbed Widgets] Can't use jquery to select tabbed widget elements
-
So I have the tabbed widget plugin loading and functioning correctly. I’m trying to use the following jquery code to just identify the number of ul’s in hopes of eventually adding some styling to li’s contained in there:
jQuery(document).ready(function($){ alert($('ul.tw-tabbed-nav').length + ' elements!'); });
The problem is my script file that contains the above, loads before the plugin finishes setting up. I noticed that for a split second when my page loads the individual widgets are displaying individually before the tabbed widget loads them into tabs. Anyone know of a way to make sure the above function doesn’t fire until after the plugins have finished loading? For the record, this is how my script file is being added to the site via my functions file:
if ( !is_admin() ) { // instruction to only load if it is not the admin area // register your script location, dependencies and version wp_register_script('vtdscripts', get_bloginfo('stylesheet_directory') . '/js/vtdscripts.js', array('jquery'), '1.0', 1 ); // enqueue the script wp_enqueue_script('vtdscripts'); }
Thanks for the help all!
- The topic ‘[Plugin: Tabbed Widgets] Can't use jquery to select tabbed widget elements’ is closed to new replies.