Team:TU-Munich/TUM13 Script
From 2013.igem.org
Line 23: | Line 23: | ||
"https://static.igem.org/mediawiki/2013/4/4e/TUM13_submenu-bg.png", | "https://static.igem.org/mediawiki/2013/4/4e/TUM13_submenu-bg.png", | ||
"https://static.igem.org/mediawiki/2013/d/db/TUM13_submenu-highlight.png" ); | "https://static.igem.org/mediawiki/2013/d/db/TUM13_submenu-highlight.png" ); | ||
+ | |||
+ | // preload footer links | ||
+ | |||
+ | preload( "https://static.igem.org/mediawiki/2013/0/05/TUM13_address-highlight.png", | ||
+ | "https://static.igem.org/mediawiki/2013/c/c7/TUM13_contact-icon-highlight.png", | ||
+ | "https://static.igem.org/mediawiki/2013/9/9f/TUM13_facebook-icon-highlight.png", | ||
+ | "https://static.igem.org/mediawiki/2013/2/22/TUM13_twitter-icon-highlight.png", | ||
+ | "https://static.igem.org/mediawiki/2013/a/a1/TUM13_youtube-icon-highlight.png" ); | ||
// preload team pictures | // preload team pictures |
Revision as of 19:48, 27 September 2013
$(document).ready(function(){
// put the footer in the right place
$("#footer-box").prepend($("#social-footer"));
// implement image preloading
function preload() {
var images = new Array() for (i = 0; i < preload.arguments.length; i++) { images[i] = new Image() images[i].src = preload.arguments[i] }
}
// preload menu backgrounds
preload( "",
"", "" );
// preload footer links
preload( "",
"", "", "", "" );
// preload team pictures
if ( $("div#teamfield").length > 0 ) { preload( "",
"", "", "", "", "", "", "", "", "", // Katrin "", "", "", "", "", "", "", "", "", // Rosario "", "", "", "", "", "", "", "", "", // Fabian "", "", "", "", "", "", "", "", "", // Andreas "", "", "", "", "", "", "", "", "", // Louise "", "", "", "", "", "", "", "", "", // Johanna "", "", "", "", "", "", "", "", "", // Meike "", "", "", "", "", "", "", "", "", // Volker "", "", "", "", "", "", "", "", "", // Polte "", "", "", "", "", "", "", "", "", // Leonie "", "", "", "", "", "", "", "", "", // Philipp "", "", "", "", "", "", "", "", "", // Jeff "", "", "", "", "", "", "", "", "", // Chris "", "", "", "", "", "", "", "", "", // Flo "", "", "", "", "", "", "", "" );
}
// Slideshows
$('.bxslider').bxSlider({
responsive: false, auto: true, autoHover: true
});
$('.bxgallery').bxSlider({
slideMargin: 10, minSlides: 3, maxSlides: 3, moveSlides: 1, slideWidth: 5000
});
// Lightbox
$("div.thumbinner > a img").slimbox({/* Put custom options here */}, function(el) { url = el.src; url = url.substring(0, url.lastIndexOf('/')); url = url.replace('/thumb/', '/'); description = $(el).parents("div.thumbinner").children("div.thumbcaption").text(); return [url, description]; }, function(el) { return (this == el); });
$("ul.bxgallery img").slimbox({ loop: true }, function(el) { url = el.src; url = url.substring(0, url.lastIndexOf('/')); url = url.replace('/thumb/', '/'); // description = $(el).parents("div.thumbinner").children("div.thumbcaption").text(); return [url, ]; }, function(el) { return (this == el) || (this.parentNode.parentNode && (this.parentNode.parentNode == el.parentNode.parentNode)); });
// Animate teamfield
if ( $("div#teamfield").length > 0 ) {
var $members = $("div#teamfield a");
$("body").mousemove(function(event){ for (i=0; i<$members.length; i++) {
if ( $members.eq(i).offset().left > event.pageX ) {
if ( $members.eq(i).offset().top > event.pageY ) {
$members.eq(i).removeClass(); $members.eq(i).addClass("top-left");
} else if ( $members.eq(i).offset().top <= event.pageY && ( $members.eq(i).offset().top + $members.eq(i).height() ) >= event.pageY ) {
$members.eq(i).removeClass(); $members.eq(i).addClass("left");
} else if ( ( $members.eq(i).offset().top + $members.eq(i).height() ) < event.pageY ) {
$members.eq(i).removeClass(); $members.eq(i).addClass("bottom-left");
}
} else if ( $members.eq(i).offset().left <= event.pageX && ( $members.eq(i).offset().left + $members.eq(i).width() ) >= event.pageX ) {
if ( $members.eq(i).offset().top > event.pageY ) {
$members.eq(i).removeClass(); $members.eq(i).addClass("top");
} else if ( $members.eq(i).offset().top <= event.pageY && ( $members.eq(i).offset().top + $members.eq(i).height() ) >= event.pageY ) {
$members.eq(i).removeClass(); $members.eq(i).addClass("front");
} else if ( ( $members.eq(i).offset().top + $members.eq(i).height() ) < event.pageY ) {
$members.eq(i).removeClass(); $members.eq(i).addClass("bottom");
}
} else if ( ( $members.eq(i).offset().left + $members.eq(i).width() ) < event.pageX ) {
if ( $members.eq(i).offset().top > event.pageY ) {
$members.eq(i).removeClass(); $members.eq(i).addClass("top-right");
} else if ( $members.eq(i).offset().top <= event.pageY && ( $members.eq(i).offset().top + $members.eq(i).height() ) >= event.pageY ) {
$members.eq(i).removeClass(); $members.eq(i).addClass("right");
} else if ( ( $members.eq(i).offset().top + $members.eq(i).height() ) < event.pageY ) {
$members.eq(i).removeClass(); $members.eq(i).addClass("bottom-right");
}
}
} });
}
});