Team:UNITN-Trento/JS/Gallery
From 2013.igem.org
(Difference between revisions)
(.thumb as link) |
|||
(7 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
- | $('#jms-slideshow').jmslideshow(); | + | var jmpressOpts = { |
+ | hash : { use : true } | ||
+ | }; | ||
+ | $('#jms-slideshow').jmslideshow( $.extend( true , { jmpressOpts : jmpressOpts }, { | ||
+ | autoplay : false, | ||
+ | arrows : true | ||
+ | })); | ||
$("#jms-slideshow .step").each(function() { | $("#jms-slideshow .step").each(function() { | ||
- | + | id = $(this).attr('id'); | |
- | $(".container .sheet").append("<a href=' | + | img = $(this).attr('data-img'); |
+ | $(".container .sheet .thumbs").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'); | ||
+ | }); | ||
}); | }); | ||
}); | }); |
Latest revision as of 15:07, 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).attr('data-img'); $(".container .sheet .thumbs").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'); }); }); });