Difference between revisions of "Template:Technion/navbar/javascript"
Line 11: | Line 11: | ||
p = $("#Judging_Criteria").offset().left-$("#Judging_Criteria_Links_Parts").width()-$("#Judging_Criteria_Links_Achievements").width()-$("#Judging_Criteria_Links_Collaborations").width(); | p = $("#Judging_Criteria").offset().left-$("#Judging_Criteria_Links_Parts").width()-$("#Judging_Criteria_Links_Achievements").width()-$("#Judging_Criteria_Links_Collaborations").width(); | ||
− | $("#Judging_Criteria_Links").css({"padding-left": (p+ | + | $("#Judging_Criteria_Links").css({"padding-left": (p+100)}); |
/*p = $("#Judging_Criteria").offset(); | /*p = $("#Judging_Criteria").offset(); | ||
if (($(window).width())*1.3 >= screen.width) | if (($(window).width())*1.3 >= screen.width) | ||
Line 49: | Line 49: | ||
p = $("#Judging_Criteria").offset().left-$("#Judging_Criteria_Links_Parts").width()-$("#Judging_Criteria_Links_Achievements").width()-$("#Judging_Criteria_Links_Collaborations").width(); | p = $("#Judging_Criteria").offset().left-$("#Judging_Criteria_Links_Parts").width()-$("#Judging_Criteria_Links_Achievements").width()-$("#Judging_Criteria_Links_Collaborations").width(); | ||
− | $("#Judging_Criteria_Links").css({"padding-left": (p+ | + | $("#Judging_Criteria_Links").css({"padding-left": (p+100)}); |
/*p = $("#Judging_Criteria").offset(); | /*p = $("#Judging_Criteria").offset(); | ||
if (($(window).width())*1.3 >= screen.width) | if (($(window).width())*1.3 >= screen.width) |
Revision as of 01:38, 18 September 2015
$(document).ready(function() { /************************reset parameters*********************************/ var p = $("#project").offset(); $("#project_Links").css({"padding-left": (p.left-0)});
p = $("#Lab_Notebook").offset(); $("#Lab_Notebook_Links").css({"padding-left": (p.left-0)});
p = $("#Human_Practices").offset(); $("#Human_Practices_Links").css({"padding-left": (p.left-0)});
p = $("#Judging_Criteria").offset().left-$("#Judging_Criteria_Links_Parts").width()-$("#Judging_Criteria_Links_Achievements").width()-$("#Judging_Criteria_Links_Collaborations").width(); $("#Judging_Criteria_Links").css({"padding-left": (p+100)}); /*p = $("#Judging_Criteria").offset(); if (($(window).width())*1.3 >= screen.width) { $("#Judging_Criteria_Links").css({"padding-left": (p.left-0)}); } else { p = $("#Judging_Criteria").offset().left-$("#Judging_Criteria_Links_Parts").width()-$("#Judging_Criteria_Links_Achievements").width()-$("#Judging_Criteria_Links_Collaborations").width()-$("#Judging_Criteria_Links_Design").width(); $("#Judging_Criteria_Links").css({"padding-left": (p-0)}); }*/
p = $("#Team").offset().left-$("#Team_Links_About_Us").width()-$("#Team_Links_Attributions").width()-$("#Team_Links_Sponsors").width()-$("#Team_Links_gallery").width(); $("#Team_Links").css({"padding-left": (p-42)}); /*p = $("#Team").offset(); if (($(window).width())*1.1 >= screen.width) { $("#Team_Links").css({"padding-left": (p.left-0)}); } else { p = $("#Team").offset().left-$("#Team_Links_About_Us").width()-$("#Team_Links_Attributions").width()-$("#Team_Links_Sponsors").width()-$("#Team_Links_gallery").width(); $("#Team_Links").css({"padding-left": (p-60)}); }*/ /************************reset parameters-end*****************************/
/************************reset parameters on resize***********************/ $(window).resize(function() { var p = $("#project").offset(); $("#project_Links").css({"padding-left": (p.left-0)});
p = $("#Lab_Notebook").offset(); $("#Lab_Notebook_Links").css({"padding-left": (p.left-0)});
p = $("#Human_Practices").offset(); $("#Human_Practices_Links").css({"padding-left": (p.left-0)});
p = $("#Judging_Criteria").offset().left-$("#Judging_Criteria_Links_Parts").width()-$("#Judging_Criteria_Links_Achievements").width()-$("#Judging_Criteria_Links_Collaborations").width(); $("#Judging_Criteria_Links").css({"padding-left": (p+100)}); /*p = $("#Judging_Criteria").offset(); if (($(window).width())*1.3 >= screen.width) { $("#Judging_Criteria_Links").css({"padding-left": (p.left-0)}); } else { p = $("#Judging_Criteria").offset().left-$("#Judging_Criteria_Links_Parts").width()-$("#Judging_Criteria_Links_Achievements").width()-$("#Judging_Criteria_Links_Collaborations").width()-$("#Judging_Criteria_Links_Design").width(); $("#Judging_Criteria_Links").css({"padding-left": (p-0)}); }*/
p = $("#Team").offset().left-$("#Team_Links_About_Us").width()-$("#Team_Links_Attributions").width()-$("#Team_Links_Sponsors").width()-$("#Team_Links_gallery").width(); $("#Team_Links").css({"padding-left": (p-42)}); /*p = $("#Team").offset(); if (($(window).width())*1.1 >= screen.width) { $("#Team_Links").css({"padding-left": (p.left-0)}); } else { p = $("#Team").offset().left-$("#Team_Links_About_Us").width()-$("#Team_Links_Attributions").width()-$("#Team_Links_Sponsors").width()-$("#Team_Links_gallery").width(); $("#Team_Links").css({"padding-left": (p-60)}); }*/ }); /************************reset parameters on resize-end*******************/
/************************on hover events for main buttons*****************/ $("#project, #project_Links a").hover(function() { $("#project_Links").css({"max-height": "50px"}); }, function() { $("#project_Links").css({"max-height": "0px"}); });
$("#Lab_Notebook, #Lab_Notebook_Links a").hover(function() { $("#Lab_Notebook_Links").css({"max-height": "50px"}); }, function() { $("#Lab_Notebook_Links").css({"max-height": "0px"}); });
$("#Human_Practices, #Human_Practices_Links a").hover(function() { $("#Human_Practices_Links").css({"max-height": "50px"}); }, function() { $("#Human_Practices_Links").css({"max-height": "0px"}); });
$("#Judging_Criteria, #Judging_Criteria_Links a").hover(function() { $("#Judging_Criteria_Links").css({"max-height": "50px"}); }, function() { $("#Judging_Criteria_Links").css({"max-height": "0px"}); });
$("#Team, #Team_Links a").hover(function() { $("#Team_Links").css({"max-height": "50px"}); }, function() { $("#Team_Links").css({"max-height": "0px"}); }); /************************on hover events for main buttons-end*************/
});