Team:UNITN-Trento/JS/Team
From 2013.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
- | + | // $('#jms-slideshow').jmslideshow(); | |
- | + | //Change image when you go on the sheet with the mouse | |
- | + | $(".sheet").each(function() { | |
- | + | $(this).mouseenter(function() { | |
- | + | src = $(this).children(".profile").attr('src'); | |
- | + | $(this).children(".profile").attr('src' , $(this).children(".profile").attr('data-src')); | |
- | + | $(this).children(".profile").attr('data-src' , src); | |
- | + | }); | |
- | + | $(this).mouseleave(function() { | |
+ | src = $(this).children(".profile").attr('src'); | ||
+ | $(this).children(".profile").attr('src' , $(this).children(".profile").attr('data-src')); | ||
+ | $(this).children(".profile").attr('data-src' , src); | ||
+ | }); | ||
+ | }); | ||
- | + | /* | |
- | + | $('#tn-content .tag').each(function() { | |
+ | $(this).click(function(e) { | ||
+ | e.preventDefault(); | ||
+ | if ($(this).attr('data-type') === "img" && !$(this).hasClass('active')) { | ||
+ | $('#tn-content .tag').removeClass('active'); | ||
+ | _self = $(this); | ||
+ | _self.addClass('active'); | ||
- | + | div = $('<div/>'); | |
- | + | $(div).addClass('tn-hoverTag'); | |
- | + | ||
- | + | ||
- | + | $(div).append('<span class="title">' + $(_self).html() + '</span><br/>'); | |
- | + | $(div).append('<img src="' + $(_self).attr('href') + '" />'); | |
- | + | $(div).append('<br/><span class="msg">Click to exit</span>'); | |
- | + | $(div).children().wrapAll('<div/>'); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | $(div).click(function(e) { | |
- | + | e.preventDefault(); | |
+ | $(div).remove(); | ||
+ | $('#tn-content .tag').removeClass('active'); | ||
+ | }); | ||
+ | $('body').append(div); | ||
+ | } else { | ||
+ | $('#tn-content .tag').removeClass('active'); | ||
+ | _self = $(this); | ||
+ | _self.addClass('active'); | ||
- | + | div = $('<div/>'); | |
- | + | $(div).addClass('tn-hoverTag'); | |
- | + | ||
- | + | ||
- | + | $(div).append('<span class="title">' + $(_self).html() + '</span><br/>'); | |
- | + | $(div).append('<iframe width="560" height="315" src="' + $(_self).attr('href') + '" frameborder="0" allowfullscreen></iframe>'); | |
- | + | $(div).append('<br/><span class="msg">Click to exit</span>'); | |
- | + | $(div).children().wrapAll('<div/>'); | |
- | + | ||
- | + | $(div).click(function(e) { | |
- | + | e.preventDefault(); | |
- | + | $(div).remove(); | |
- | + | $('#tn-content .tag').removeClass('active'); | |
- | + | }); | |
+ | $('body').append(div); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | */ | ||
}); | }); |
Revision as of 14:09, 15 September 2013
$(document).ready(function() {
// $('#jms-slideshow').jmslideshow();
//Change image when you go on the sheet with the mouse $(".sheet").each(function() { $(this).mouseenter(function() { src = $(this).children(".profile").attr('src'); $(this).children(".profile").attr('src' , $(this).children(".profile").attr('data-src')); $(this).children(".profile").attr('data-src' , src); }); $(this).mouseleave(function() { src = $(this).children(".profile").attr('src'); $(this).children(".profile").attr('src' , $(this).children(".profile").attr('data-src')); $(this).children(".profile").attr('data-src' , src); }); });
/* $('#tn-content .tag').each(function() { $(this).click(function(e) { e.preventDefault(); if ($(this).attr('data-type') === "img" && !$(this).hasClass('active')) { $('#tn-content .tag').removeClass('active'); _self = $(this); _self.addClass('active');
div = $('<div/>'); $(div).addClass('tn-hoverTag');
$(div).append('' + $(_self).html() + '
'); $(div).append('<img src="' + $(_self).attr('href') + '" />'); $(div).append('
Click to exit'); $(div).children().wrapAll('<div/>');
$(div).click(function(e) { e.preventDefault(); $(div).remove(); $('#tn-content .tag').removeClass('active'); }); $('body').append(div); } else { $('#tn-content .tag').removeClass('active'); _self = $(this); _self.addClass('active');
div = $('<div/>'); $(div).addClass('tn-hoverTag');
$(div).append('' + $(_self).html() + '
'); $(div).append('<iframe width="560" height="315" src="' + $(_self).attr('href') + '" frameborder="0" allowfullscreen></iframe>'); $(div).append('
Click to exit'); $(div).children().wrapAll('<div/>');
$(div).click(function(e) { e.preventDefault(); $(div).remove(); $('#tn-content .tag').removeClass('active'); }); $('body').append(div); } }); }); */
});