Team:UNITN-Trento/JS/Gallery

From 2013.igem.org

(Difference between revisions)
(Clicking on a thumbnail changes the slide)
Line 9: Line 9:
$("#jms-slideshow .step").each(function() {
$("#jms-slideshow .step").each(function() {
 +
id = $(this).attr('id');
img = $(this).css('background-image').split("\"")[1];
img = $(this).css('background-image').split("\"")[1];
-
$(".container .sheet").append("<a href='javascript:alert(1);' class='thumb'><img src='"+img+"' /></a>");
+
$(".container .sheet").append("<a href='javascript:document.location.hash = " + id + ";' class='thumb'><img src='" + img + "' /></a>");
});
});
});
});

Revision as of 14:11, 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='javascript:document.location.hash = " + id + ";' class='thumb'><img src='" + img + "' /></a>"); }); });