Files
headphones/data/js/FancyScript.js
2012-03-13 22:51:00 +01:00

36 lines
1.0 KiB
JavaScript

//Mark current active link
$(document).ready(function () {
$("#nav li a").each(function () {
var hreflink = $(this).attr("href");
if (hreflink == location.href.split("/").pop()) {
$(this).parent().addClass("selected");
}
});
});
//Resize #main to fit window size
$(document).ready(function() {
//On load set #main height & width
windowWidth = $(window).width();
windowHeight = $(window).height();
menuWidth = $("#nav").width();
headerHeight = $("header").height();
$("#main").height(windowHeight - headerHeight - 40);
$("#main").width(windowWidth - menuWidth - 10);
});
//On window resize
$(window).resize(function() {
windowWidth = $(window).width();
windowHeight = $(window).height();
menuWidth = $("#nav").width();
headerHeight = $("header").height();
$("#main").height(windowHeight - headerHeight - 40);
$("#main").width(windowWidth - menuWidth - 10);
});
//Update close
$(document).ready(function () {
$(".btnClose").click(function() {
$("#updatebar").fadeOut("slow");
});
});