Team:UNITN-Trento/JS/Extra

From 2013.igem.org

Revision as of 10:14, 23 September 2013 by Ggirelli (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

$(document).ready(function() { //Remove default click of .dot $(".dot").click(function(e) { e.preventDefault(); });


$(".spot").each(function() { // Remove .spot default click $(this).click(function(e) { e.preventDefault() }); //Change .dot content when mouseenter spot $(this).mouseenter(function() { id = $(this).attr('id'); var url = "", img = "", title = "", desc = ""; switch(id) { case "spot1": { url = "https://2013.igem.org/Team:UNITN-Trento/Attributions"; img = "Tn-2013-tour_circle-Vending-machine.png"; title = "Attributions"; desc = "In this page you can find all the fantastic people that supported the team all over this summer, and also the masters (guru) of each part of the project."; break; }

case "spot2": { url = "https://2013.igem.org/Team:UNITN-Trento/Extra/Fruit%20Info"; img = "Tn-2013-tour_circle-Home-edition.png"; title = "Fruit Info"; desc = "Some cute info about fruit that maybe you still don’t know! Check it out!"; break; }

case "spot3": { url = "https://2013.igem.org/Team:UNITN-Trento/Human_Practice"; img = "Tn-2013-tour_circle-Vending-machine.png"; title = "Human Practice"; desc = "The team meets the people at the market, asking for opinions and suggestions about B. fruity!"; break; }

case "spot4": { url = "https://2013.igem.org/Team:UNITN-Trento/Safety"; img = "Tn-2013-tour_circle-Home-edition.png"; title = "Safety"; desc = "Synthetic biology is such an exciting subject but obviously the team considered how to improve the project to make it as safe as possible!"; break; }

case "spot5": { url = "https://2013.igem.org/Team:UNITN-Trento/Sponsor"; img = "Tn-2013-tour_circle-Vending-machine.png"; title = "Sponsor"; desc = "Here are the people who made this project possible and who first believed in the team!"; break; } }

//Change dot link $(".dot").click(function(e) { document.location.href = url; }); $(".dot .circle").attr("src" , img); $(".dot .title").html(title); $(".dot .descr").html(desc); }); });


});