Files
2026-02-07 15:48:27 +08:00

69 lines
2.4 KiB
JavaScript

$(document).ready(function(){
//底部栏目
var gd_body=$(document.body).height();
var gd_footer=$("#footer").height();
var gd_top=$("#top").height()+$("#header").height()+$("#topnav").height()+$("#search").height();
var gd_window=$(window).height();
if(gd_body<=gd_window){
var gd_main=gd_window-gd_top-gd_footer-55;
$("#main").css("height",gd_main);
}
$(window).resize(function() {
var gd_window=$(window).height();
if(gd_body<=gd_window){
var gd_main=gd_window-gd_top-gd_footer-55;
$("#main").css("height",gd_main);
}
});
//通用下拉菜单
$(".selecter").each(function(i,dom){
$(dom).children("h2").mouseover(function(){
$(dom).children("h2").addClass("hover");
$(dom).children("ul").addClass("indextop");
$(dom).children("ul").after("<iframe></iframe>");
});
$(dom).children("h2").mouseout(function(){
$(dom).children("h2").removeClass("hover");
$(dom).children("ul").removeClass("indextop");
$(dom).children("iframe").remove();
});
$(dom).children("ul").mouseover(function(){
$(dom).children("h2").addClass("hover");
$(dom).children("ul").addClass("indextop");
$(dom).children("ul").after("<iframe></iframe>");
});
$(dom).children("ul").mouseout(function(){
$(dom).children("h2").removeClass("hover");
$(dom).children("ul").removeClass("indextop");
$(dom).children("iframe").remove();
});
});
//topnav下拉菜单
$("#topnav div").each(function(i,dom){
var gd_iframe=$(dom).children("ul").height();
$(dom).children("span").mouseover(function(){
$(dom).children("span").addClass("hover");
$(dom).children("ul").addClass("indextop");
$(dom).children("ul").after("<iframe></iframe>");
$(dom).children("iframe").css("height",gd_iframe);
});
$(dom).children("span").mouseout(function(){
$(dom).children("span").removeClass("hover");
$(dom).children("ul").removeClass("indextop");
$(dom).children("iframe").remove();
});
$(dom).children("ul").mouseover(function(){
$(dom).children("span").addClass("hover");
$(dom).children("ul").addClass("indextop");
$(dom).children("ul").after("<iframe></iframe>");
$(dom).children("iframe").css("height",gd_iframe);
});
$(dom).children("ul").mouseout(function(){
$(dom).children("span").removeClass("hover");
$(dom).children("ul").removeClass("indextop");
$(dom).children("iframe").remove();
});
});
//
})