Team:UNITN-Trento/JS/Team

From 2013.igem.org

(Difference between revisions)
Line 16: Line 16:
e.preventDefault();
e.preventDefault();
swapBg($(this).children('img'));
swapBg($(this).children('img'));
 +
});
 +
});
 +
 +
$('#jms-slideshow .tag').each(function() {
 +
$(this).click(function(e) {
 +
e.preventDefault();
 +
alert(1);
});
});
});
});
});
});

Revision as of 07:31, 13 August 2013

function swapBg(img) { alt = $(img).attr('data-alt'); src = $(img).attr('src'); $(img).fadeOut('fast', function() { $(img).attr('src',alt); $(img).attr('data-alt',src); $(img).fadeIn(); }); }

$(document).ready(function() { $( '#jms-slideshow' ).jmslideshow();

$('#jms-slideshow .image').each(function() { $(this).click(function(e) { e.preventDefault(); swapBg($(this).children('img')); }); });

$('#jms-slideshow .tag').each(function() { $(this).click(function(e) { e.preventDefault(); alert(1); }); }); });