Firefox 和 Safari 的弹出工作, 但不在 Internet Explorer 9. 使用 Internet Explorer 9 中的 Dev 工具, 我发现以下错误( 函数 OpenPopUp 中的错误) 。
SCRIPT438: Object doesn t support this property or method script2.js, line 92 character 5
Here is <script2.js>
var popup_content_cache = ;
var popup_content_src_id = ;
jQuery.fn.center = function () {
console.log("*****NEW******");
this.css("position", "absolute");
this.css("top", (($(window).height() - this.outerHeight()) / 2) +
$(window).scrollTop() + "px");
this.css("left", (($(window).width() - this.outerWidth()) / 2) +
$(window).scrollLeft() + "px");
console.log(this.css( top ));
console.log(parseInt(this.css( top )));
if (parseInt(this.css( top )) < 0) this.css( top , 20px );
console.log(parseInt(this.css( top )));
return this;/*
this.css("position","absolute");
var top=($(window).height() - this.outerHeight())/2;
console.log("top: " + top)
console.log($(window).height());
console.log(this.outerHeight());
if(top<0){
console.log("** IF");
this.css("top", "20px");
this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
}
else {
this.css("top", (($(window).height() - this.outerHeight()) / 2) +
$(window).scrollTop() + "px");
this.css("left", (($(window).width() - this.outerWidth()) / 2) +
$(window).scrollLeft() + "px");
}
console.log();
return this;*/
}
function openLayerBC() {
tWidth = $(document).width();
tHeight = $(document).height();
//$("select").fadeOut( fast );
$( #filter ).css("width", tWidth + "px");
$( #filter ).css("height", tHeight + "px");
// $( #filter ).css( z-index ,9990);
$("#filter").css("opacity", 0.8);
$( #filter ).fadeIn( fast );
//$( #filter ).bind("click",closePopup1);
$( #filter,#close ).click(function () {
$( #filter ).fadeOut( fast );
$( #case_light_box ).hide();
o = document.getElementById( divid );
o.style.display = o.style.display === block ? none : block ;
});
}
function closePopup() {
$( #filter ).fadeOut( fast );
o = document.getElementById( popup );
o.style.display = none ;
// o.style.display = o.style.display== block ? none : block ;
$(o).css("position","absolute");
$(popup_content_src_id).html(popup_content_cache);
var popup_content_cache = ;
var popup_content_src_id = ;
}
function openPopUp(div) {
openLayerBC();
div = div.replace( # , );
file = div;
page = /v/vspfiles/templates/OSS/ajax/products/ + div + .html ;
$.get(page, {}, function(data)
{
msgbox = document.getElementById( popup );
$(msgbox).html(data);
$(msgbox).css( width ,$( # +div).css( width ));
$( # +div).show();
$(msgbox).center();
$(msgbox).show();
});
}
下面是 & lt; script2. js> 信件所引用的 & lt; title2. js> 行 92 。
page = /v/vspfiles/templates/OSS/ajax/products/ +div+ .html ;
免责声明:我继承了JavaScript的代码, 我对JavaScript及其语法没有什么经验。