How do I add controls to slideshow?
Hi,
The slideshow is already there, I believe using JQuery Cycle but I want to add buttons so you can jump to a slide rather than have to wait for it to come around again.
I've seen the 'pager' option here:
http://jquery.malsup.com/cycle/pager.html and I'd like to add something similar to our slideshow but I can figure out where to put that code as, no matter how I do it, it doesn't seem to add a pager to our homepage, is there something else I need to puyt in the HTML for the page or the CSS for the site?
Also, is there someway of re-styling the numbers to bullet points or something a little more stylish than what is there?
The section of the site's javascript file that applies to the feature section is below, hope this helps but let me know if I need to post anything from the JQuery Cycle file or anything else.
Many Thanks in advance for any help you can provide.
- // Home page featured area
- $(document).ready(function(){
- $('.feature_images')
- .cycle({
- fx: 'fade',
- speed: 300,
- timeout: 4000,
- before: function(currSlideElement, nextSlideElement, options, forwardFlag) {
- $('.feature_list li').removeClass('highlight');
- $('.feature'+($(nextSlideElement).index()+1)).addClass('highlight');
-
- $('.feature1').hover(function() {
- $('.feature_images').cycle(0);
- $('.feature_list li').removeClass('highlight');
- $(this).addClass('highlight');
- }, function() {}
- );
- $('.feature2').hover(function() {
- $('.feature_images').cycle(1);
- $('.feature_list li').removeClass('highlight');
- $(this).addClass('highlight');
- }, function() {}
- );
- $('.feature3').hover(function() {
- $('.feature_images').cycle(2);
- $('.feature_list li').removeClass('highlight');
- $(this).addClass('highlight');
- }, function() {}
- );
- $('.feature4').hover(function() {
- $('.feature_images').cycle(3);
- $('.feature_list li').removeClass('highlight');
- $(this).addClass('highlight');
- }, function() {}
- );
- $('.feature5').hover(function() {
- $('.feature_images').cycle(4);
- $('.feature_list li').removeClass('highlight');
- $(this).addClass('highlight');
- }, function() {}
- );
- $('.feature_list li').click(function() {
- var url = $(this).find('a').attr("href");
- $(location).attr('href',url);
- });
- });
The HTML for the page is as follows:
- <div class="featured_wrapper clearfix">
- <div class="featured">
-
- <div class="featured_shadow"></div>
- <div class="feature_images">
-
- {exp:channel:entries channel="featured" limit="5" dynamic="no"}
-
- <div class="slider">
- <a href="{if "{featured_link}"<>""}{featured_link}{if:else}/news/view/{related_entries id="featured_news_link"}{url_title}{/related_entries}{/if}"><img src="{featured_image}" alt="{title}" /></a>
- <div class="headline">
- <div class="headline_bot">
- <h3><a href="{if "{featured_link}"<>""}{featured_link}{if:else}/news/view/{related_entries id="featured_news_link"}{url_title}{/related_entries}{/if}">{title}</a></h3>
- <p><a href="{if "{featured_link}"<>""}{featured_link}{if:else}/news/view/{related_entries id="featured_news_link"}{url_title}{/related_entries}{/if}">{featured_abstract}</a></p>
- <div class="controls">
- </div>
- </div>
- </div>
- </div>
-
- {/exp:channel:entries}
- </div><!--/feature_images-->
-
-
- <ul class="feature_list">
- {exp:channel:entries site="not moo" channel="not moo" entry_id="{exp:n_categories:get_news_bsuk frontpage='TRUE'}" orderby="date" paginate="bottom" limit="5" dynamic="no" parse="inward"}
- <li class="feature">
- <a href="{url_title_path="/news/view"}">{title}</a>
-
- {/exp:channel:entries}
- </ul>
- </div><!--/featured_shadow-->
- </div><!--/featured-->
- </div><!--/featured_wrapper-->