这是我将鼠标悬停在图像上时使警报出现的代码;
var special_offers = document.getElementsByClassName("special_offer");
//for each special offer
for(i=0;i<special_offers.length;i++){
var special_offer = special_offers[i];
special_offer.setAttribute("offer_shown", "0");
special_offer.onmouseover = function(){
if( this.getAttribute("offer_shown") == "0" ){
this.setAttribute("offer_shown", "1");
alert('This room has the special offer attached to it, please book soon before you miss out!');
}
}
我想知道如何将它从沼泽标准 JS 警报更改为我可以设置样式的框,我想我会使用某种 div。
任何帮助深表感谢。