/ Published in: JavaScript
Expand |
Embed | Plain Text
if ($('#featured').length>0){ var titles = $('#featured-images').find("img").map(function() { return $(this).attr("title"); }); counter=-1; imgs = new Array(); x=0; $("#featured-images img").each(function(index){ console.log($(this).attr("alt")); imgs[x] = $(this).attr("alt"); x++; }); $('#featured-images').before('<ul id="featurednav"></ul>').cycle( { pager: '#featurednav', after: function(currSlideElement) { counter++; if(counter>=x){ counter=0; } $("#description").text(imgs[counter]); }, pagerAnchorBuilder: function (index) { return '<li><a href="#">' + titles[index] + '</a></li>'; } }); }
You need to login to post a comment.
