javascript - Changing pagination using pagerFactory -


i hope can help. trying change how pagination displayed using cycle.js plugin.

at moment function counts how many slides there , numbers them accordingly, need remove these , replace numbers words.

this original function:

$(function() {  $('#slideshow').cycle({     fx:      'scrollhorz',     timeout:  0,     prev:    '#prev',     next:    '#next',     pager:   '.ms-links',     pageranchorbuilder: pagerfactory });  function pagerfactory(idx, slide) {     var s = idx > 3 ? ' style="display:none"' : '';     return '<li'+s+'><a href="#">'+(idx+1)+'</a></li>'; }; 

});

and have tried thinking might work:

$(function() {  $('#slideshow').cycle({     fx:      'scrollhorz',     timeout:  0,     prev:    '#prev',     next:    '#next',     pager:   '.ms-links',     pageranchorbuilder: pagerfactory });  function pagerfactory(idx, slide) {         var s = idx > 3 ? ' style="display:none"' : '';             var strcat = "";             if idx = 1 { strcat = "news";}             if idx = 2 { strcat = "blogs";}             if idx = 3 { strcat = "mstv";}             if idx = 4 { strcat = "publications";}          return '<li'+s+'><a href="#">'+(strcat)+'</a></li>';     }; 

});

but breaks - i'm not jquery expert may simple. have 4 sliders, there never more 4 , need name them 'news, blogs, tv , publications'

any advice on how work appreciated, thank you!

gav


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -