Description
Dynamic jQuery setting the selector, function and option parametersNote: jQuery(document).ready( fn ) has been deprecated in jQuery 3.0
Usage
bw_jquery( $selector, $method, $parms, $windowload );Parameters
- $selector
- ( string ) required – the jQuery selector
- $method
- ( string ) required – the jQuery method to invoke
- $parms
- ( string ) optional – parameters overriding the method's defaults
- $windowload
- ( bool ) optional – use true when you need to wait for images to load
Returns
voidSource
File name: oik/libs/bobbfunc.phpLines:
1 to 14 of 14
function bw_jquery( $selector, $method, $parms=null, $windowload=false ) { if ( defined('DOING_AJAX') && DOING_AJAX ) { return; } bw_jq( "<script type=\"text/javascript\">" ); if ( $windowload ) { $jqfn = 'jQuery(window).on( "load", function()'; } else { $jqfn = "jQuery( function()"; } $function = "$jqfn { jQuery( \"$selector\" ).$method( $parms ); });"; bw_jq( $function ); bw_jq( "</script>" ); }View on GitHub View on Trac
Called by
1 to 8 of 8
- ajax_bobbfunc::test_bw_jquery_noop_when_doing_ajax() –
- bwsc_jquery() – Implement the [bw_jq] shortcode
- bw_accordion() – Display pages styled for jQuery accordion
- bw_countdown() – Implement the [bw_countdown] shortcode
- bw_cycle() – Implement bw_cycle shortcode that will handle all the things that we’ve had to do by hand until now
- bw_form_field_date() – bw_form_field_date – format a date field
- bw_jquery_af() – Simple jQuery anonymous function
- bw_tabs() – Implement the [bw_tabs] shortcode to display posts or pages styled for jQuery tabs
