Team:UNITN-Trento/JS/Gallery

From 2013.igem.org

(Difference between revisions)
m (Clicking on a thumbnail changes the slide)
m
Line 11: Line 11:
id = $(this).attr('id');
id = $(this).attr('id');
img = $(this).css('background-image').split("\"")[1];
img = $(this).css('background-image').split("\"")[1];
-
$(".container .sheet").append("<a class='thumb' data-id='" + id + "'><img src='" + img + "' /></a>");
+
$(".container .sheet").append("<a href='' class='thumb' data-id='" + id + "'><img src='" + img + "' /></a>");
});
});

Revision as of 14:14, 23 September 2013

$(document).ready(function() { var jmpressOpts = { hash : { use : true } }; $('#jms-slideshow').jmslideshow( $.extend( true , { jmpressOpts : jmpressOpts }, { autoplay : false, arrows : true }));

$("#jms-slideshow .step").each(function() { id = $(this).attr('id'); img = $(this).css('background-image').split("\"")[1]; $(".container .sheet").append("<a href= class='thumb' data-id='" + id + "'><img src='" + img + "' /></a>"); });

$(".container .sheet a").each(function() { $(this).click(function(e) { e.preventDefault(); window.location.hash = $(this).attr('data-id'); }); }); });