Genius, smart, scientist and inventor, worship in the head, ideas factory

jQuery slideviewer modification

I have modified slideViewer 1.2 to hide the numbers strip if there is only one image shown in the gallery. It was displaying the number [1] tile which was not needed. With red color is what I have added:

var counter = 0;
container.find(“ul”).css(“width” , stripViewerWidth);
container.css(“width” , pictWidth);
container.css(“height” , pictHeight);
container.each(function(i)
{

jQuery(this).after(“<div class=’stripTransmitter’ id=’stripTransmitter” + (j) + “‘><ul><\/ul><\/div>”);
jQuery(this).find(“li”).each(
function(n)
{
jQuery(“div#stripTransmitter” + j + ” ul”).append(“<li><a title=’” + jQuery(this).find(“img”).attr(“alt”) + “‘ href=’#'>”+(n+1)+”<\/a><\/li>”);
counter++;
});
if (counter<2) { document.getElementById(“stripTransmitter0″).style.display = ‘none’; }
jQuery(“div#stripTransmitter” + j + ” a”).each(
function(z)
{
jQuery(this).bind(“click”, function()
{
jQuery(this).addClass(“current”).parent().parent().find(“a”).not(jQuery(this)).removeClass(“current”); // wow!
var cnt = -(pictWidth*z);
container.find(“ul”).animate({ left: cnt}, settings.easeTime, settings.easeFunc);
return false;
});
});

The jQuery slideViewer can be found here.
Hope it is of help for others too!

Leave a Reply

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>