mirror of
https://github.com/rembo10/headphones.git
synced 2026-04-22 21:09:26 +01:00
24 lines
702 B
JavaScript
24 lines
702 B
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 () {
|
|
windowWidth = $(window).width();
|
|
windowHeight = $(window).height();
|
|
menuWidth = $("#nav").width();
|
|
$("#main").width(windowWidth - menuWidth - 40);
|
|
});
|
|
|
|
//On window resize
|
|
$(window).resize(function () {
|
|
windowWidth = $(window).width();
|
|
windowHeight = $(window).height();
|
|
menuWidth = $("#nav").width();
|
|
$("#main").width(windowWidth - menuWidth - 40);
|
|
}); |