日期:2014-05-16  浏览次数:20373 次

html页面的js如何调用js文件里的方法
xkb.bgShow=function(){
if(typeof $("#bodybg").attr("id") == 'undefined') {
$("body").append('<div id="bodybg" style="z-index:3;display:none; position:absolute; background:#000000;"></div>');
}
$("#bodybg").css("top", 0).css("left", 0).css("width", document.body.scrollWidth ).css("height", document.body.scrollHeight ).css("opacity", 0.5).fadeIn();
if($.browser.msie && $.browser.version=="6.0"){
if(typeof $("#bodybg_iframe").attr("id") == 'undefined') {
$("body").append('<iframe id="bodybg_iframe" src="javascript:false;" style="opacity:0.1;display:none; position:absolute; background:#000000; z-index:2;"></iframe>');
}
$("#bodybg_iframe").css("top", 0).css("left", 0).css("width", document.body.scrollWidth ).css("height", document.body.scrollHeight ).css("opacity", 0).fadeIn();
}
};
//隐藏背景
xkb.bgHide=function(){
  $("#bodybg").fadeOut();
if($("#bodybg_iframe")){
$("#bodybg_iframe").fadeOut();
}




这两个方法,是蒙版函数,我该怎么调用?

------解决方案--------------------
直接用
js文件加载到页面上和等同于直接把文件中代码写在页面上