[Plugin: AnythingSlider for WordPress] [AnythingSlider] Not work when JQuery in the footer (WP-plugi
-
In my template JQuery loads in the footer, it’s better for loading page faster.
jtd-anything-slider.php
global $anythingSliderScripts;
$anythingSliderScripts = “
<script>
jQuery(function() {
jQuery(‘#slider-{$id}’).anythingSlider({theme : ‘{$theme}’,
expand : {$expand},
resizeContents : {$resizeContents},
vertical : {$vertical},
showMultiple : {$showMultiple},
easing : ‘{$easing}’,buildArrows : {$buildArrows},
buildNavigation : {$buildNav},
buildStartStop : {$startStopped},toggleArrows : {$toggleArrows},
toggleControls : {$toggleControls},startText : ‘{$startText}’,
stopText : ‘{$stopText}’,
forwardText : ‘{$forwardText}’,
backText : ‘{$backText}’,
tooltipClass : ‘{$tooltipClass}’,enableArrows : {$enableArrows},
enableNavigation : {$enableNav},
enableStartStop : {$enablePlay},
enableKeyboard : {$enableKeyboard},startPanel : ‘{$startPanel}’,
changeBy : ‘{$changeBy}’,
hashTags : {$hashTags},
infiniteSlides : {$infiniteSlides},
navigationFormatter : {$navFormat},autoPlay : {$autoPlay},
autoPlayLocked : {$autoPlayLocked},
autoPlayDelayed : {$autoPlayDelayed},
pauseOnHover : {$pauseOnHover},
stopAtEnd : {$stopAtEnd},
playRtl : {$playRtl},delay : {$delay},
resumeDelay : {$resumeDelay},
animationTime : {$animation},
delayBeforeAnimate : {$fadeTiming},clickForwardArrow : ‘{$clickForwardArrow}’,
clickBackArrow : ‘{$clickBackArrow}’,
clickControls : ‘{$clickControls}’,
clickSlideshow : ‘{$clickSlideshow}’,resumeOnVideoEnd : {$video},
addWmodeToObject : ‘{$addWmode}’});
});
</script>”;if ( $fade !== ‘false’ ) {
$anythingSliderScripts .= “
<script>
jQuery(function() {
jQuery(‘#slider-{$id}’).anythingSliderFx({
‘.panel’ : [ ‘fade’, ”, {$fadeTiming}, ‘{$easing}’ ]
});
});
</script>
“;}
} wp_reset_query();
return $output;
do_action( “add_anything_slider_FX”, $id );
do_action( “add_anything_slider_FX_{$id}”, $id );}
add_action(‘wp_footer’, ‘anythingSliderScripts’, 9);
function anythingSliderScripts(){
global $anythingSliderScripts;
echo $anythingSliderScripts ;
}https://www.ads-software.com/extend/plugins/anythingslider-for-wordpress/
- The topic ‘[Plugin: AnythingSlider for WordPress] [AnythingSlider] Not work when JQuery in the footer (WP-plugi’ is closed to new replies.