tip: how to rotate your banners with jQuery Cycle
-
i think i’ve found a way to rotate banners using jQuery Cycle.
the site is already loading the jquery.cycle.all.js script cos i’m using Meteor Slides – if yours doesn’t, find a way to load the script, probably through your functions.php or another slideshow plugin.
all you need then is to set your WP Bannerize widget to show more than 1 banner (of course) and to target the group’s css class with the jQuery Cycle function:
<script type=”text/javascript”>
jQuery(document).ready(function() {
jQuery(‘.group-468×60’).cycle({
fx: ‘fade’ // choose your transition type, ex: fade, scrollUp, shuffle, etc…
});
});
</script>(you could, of course, target all of your ad widgets by using the .wp_bannerize class)
to insert the javascript above, i’m using the Enhanced Text plugin, introducing a widget right above the WP Bannerize one.
to recap: install Metero Slides (or make sure jquery.cycle.all.js is loaded on your site), install Enhanced Text (or any other plugin that lets you add javascript in a text widget), set WP Bannerize widget “Max” to more than 1, insert the jQuery Cycle function with your desired effect right above it.
that’s all.for more jQuery Cycle effects and settings, visit:
https://jquery.malsup.com/cycle/
- The topic ‘tip: how to rotate your banners with jQuery Cycle’ is closed to new replies.