我编写了五个弹出式横幅的代码,前两个可以通过点击" X"关闭,但其他人不能。任何人都可以为我检查代码吗?我应该在哪里修改?感谢。
这些横幅有五个ID:#closeadv
,#closeadv2
,#closeadv3
,#closeadv4
,#closeadv5
jQuery(function($) {
$("#closeadv").click(function() {
$("#hovertree_float_layer").fadeOut("slow");
});
$(window).resize(function() {
console.log("hovertree_float_layer: " + $("#hovertree_float_layer").width() + " window: " + $(window).width());
var left = ($(window).width() - $("#hovertree_float_layer").width()) / 2 + "px";
$("#hovertree_float_layer").css("left", left);
});
$("#closeadv2").click(function() {
$("#hovertree_float_layer2").fadeOut("slow");
});
if ($(window).width() <= 414)
$("#hovertree_float_layer2").css("width", "125px");
else if ($(window).width() > 414 && $(window).width() <= 768)
$("#hovertree_float_layer2").css("width", "200px");
else
$("#hovertree_float_layer2").css("width", "auto");
$(window).resize(function() {
if ($(window).width() <= 414)
$("#hovertree_float_layer2").css("width", "125px");
else if ($(window).width() > 414 && $(window).width() <= 768)
$("#hovertree_float_layer2").css("width", "200px");
else
$("#hovertree_float_layer2").css("width", "auto");
});
});
function showDiscount() {
jQuery(function($) {
$("#hovertree_float_layer").fadeIn("slow");
});
}
function showDiscount2() {
jQuery(function($) {
$("#hovertree_float_layer2").fadeIn("slow");
});
}
function showDiscount3() {
jQuery(function($) {
$("#hovertree_float_layer3").fadeIn("slow");
});
};
function setposotion() {
console.log("hovertree_float_layer: " + $("#hovertree_float_layer").width() + " window: " + $(window).width());
var left = ($(window).width() - $("#hovertree_float_layer").width()) / 2 + "px";
$("#hovertree_float_layer").css("left", left);
}