Team:UNITN-Trento/JS/Team

From 2013.igem.org

(Difference between revisions)
 
(5 intermediate revisions not shown)
Line 1: Line 1:
$(document).ready(function() {
$(document).ready(function() {
-
$('#jms-slideshow').jmslideshow();
+
    // $('#jms-slideshow').jmslideshow();
-
$('#tn-content .tag').each(function() {
+
    //Change image when you go on the paper with the mouse
-
$(this).click(function(e) {
+
    $(".paper").each(function() {
-
e.preventDefault();
+
        $(this).mouseenter(function() {
-
if ($(this).attr('data-type') === "img" && !$(this).hasClass('active')) {
+
            $(this).children(".profile").css({'display' : 'none'});
-
$('#tn-content .tag').removeClass('active');
+
            $(this).children(".foto-2").css({'display' : 'inline-block'});
-
_self = $(this);
+
        });
-
_self.addClass('active');
+
        $(this).mouseleave(function() {
 +
            $(this).children(".profile").css({'display' : 'none'});
 +
            $(this).children(".profile").not(".foto-2").css({'display' : 'inline-block'});
 +
        });
 +
    });
-
div = $('<div/>');
+
    /*
-
$(div).addClass('tn-hoverTag');
+
    $('#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).append('<span class="title">' + $(_self).html() + '</span><br/>');
+
                div = $('<div/>');
-
$(div).append('<img src="' + $(_self).attr('href') + '" />');
+
                $(div).addClass('tn-hoverTag');
-
$(div).append('<br/><span class="msg">Click to exit</span>');
+
-
$(div).children().wrapAll('<div/>');
+
-
$(div).click(function(e) {
+
                $(div).append('<span class="title">' + $(_self).html() + '</span><br/>');
-
e.preventDefault();
+
                $(div).append('<img src="' + $(_self).attr('href') + '" />');
-
$(div).remove();
+
                $(div).append('<br/><span class="msg">Click to exit</span>');
-
$('#tn-content .tag').removeClass('active');
+
                $(div).children().wrapAll('<div/>');
-
});
+
-
$('body').append(div);
+
-
} else {
+
-
$('#tn-content .tag').removeClass('active');
+
-
_self = $(this);
+
-
_self.addClass('active');
+
-
div = $('<div/>');
+
                $(div).click(function(e) {
-
$(div).addClass('tn-hoverTag');
+
                    e.preventDefault();
 +
                    $(div).remove();
 +
                    $('#tn-content .tag').removeClass('active');
 +
                });
 +
                $('body').append(div);
 +
            } else {
 +
                $('#tn-content .tag').removeClass('active');
 +
                _self = $(this);
 +
                _self.addClass('active');
-
$(div).append('<span class="title">' + $(_self).html() + '</span><br/>');
+
                div = $('<div/>');
-
$(div).append('<iframe width="560" height="315" src="' + $(_self).attr('href') + '" frameborder="0" allowfullscreen></iframe>');
+
                $(div).addClass('tn-hoverTag');
-
$(div).append('<br/><span class="msg">Click to exit</span>');
+
-
$(div).children().wrapAll('<div/>');
+
-
$(div).click(function(e) {
+
                $(div).append('<span class="title">' + $(_self).html() + '</span><br/>');
-
e.preventDefault();
+
                $(div).append('<iframe width="560" height="315" src="' + $(_self).attr('href') + '" frameborder="0" allowfullscreen></iframe>');
-
$(div).remove();
+
                $(div).append('<br/><span class="msg">Click to exit</span>');
-
$('#tn-content .tag').removeClass('active');
+
                $(div).children().wrapAll('<div/>');
-
});
+
 
-
$('body').append(div);
+
                $(div).click(function(e) {
-
}
+
                    e.preventDefault();
-
});
+
                    $(div).remove();
-
});
+
                    $('#tn-content .tag').removeClass('active');
 +
                });
 +
                $('body').append(div);
 +
            }
 +
        });
 +
    });
 +
    */
});
});

Latest revision as of 13:55, 26 September 2013

$(document).ready(function() {

   // $('#jms-slideshow').jmslideshow();
   //Change image when you go on the paper with the mouse
   $(".paper").each(function() {
       $(this).mouseenter(function() {
           $(this).children(".profile").css({'display' : 'none'});
           $(this).children(".foto-2").css({'display' : 'inline-block'});
       });
       $(this).mouseleave(function() {
           $(this).children(".profile").css({'display' : 'none'});
           $(this).children(".profile").not(".foto-2").css({'display' : 'inline-block'});
       });
   });
   /*
   $('#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);
           }
       });
   });
   */

});