SCUT-Champion-Park overview.js

function setElementSize() { //动态设置各元素尺寸 var doc_width = $(document).width(); var header_width = doc_width * 0.4887; var footer_width = doc_width * 0.1541;

$(".banner").css('min-height', header_width); //设置header背景图片高度 $(".footer").css('min-height', footer_width); //设置footer背景图片高度 $(".container-decorator").css('margin-top', -(header_width-175)); //设置遮罩层高度 $(".container-decorator-content ").css('height', $(".content-container").height()-206); //设置主遮罩层宽度 $(".content-container").css('margin-top', -$(".container-decorator").height()); //设置main-container高度 }

$(function($) { setElementSize();

/* 下拉菜单 */ $(".menu-table td").bind("mouseover", function() { $(this).children(".menu-list").slideDown(); }); $(".menu-table td").bind("mouseleave", function() { $(this).children(".menu-list").slideUp(); });

/* 菜单点击事件 */ $(".menu-list li").bind('click', function() { $(".menu-tag").css('border-bottom', 'none'); //清除所有下划线 $(this).parent().siblings('.menu-tag').css('border-bottom', '3px solid #a4e9f9'); //在对应父菜单条目下添加下划线

var li_obj = $(this); var url = './' + $(this).attr('url'); //获取页面url $.ajax({ url: url, type: 'GET', success: function(html){ $(".content").html(html); }

}) .done(function() { console.log("success");

}) .fail(function() { console.log("error"); }) .always(function() { console.log("complete"); }); }); });