這是我的代碼,當我將鼠標懸停在圖像上時,警告就會出現;JavaScript onmouseover警報
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的。
任何幫助,非常感謝。
搜索模態窗口。 jQuery UI有一些你可以使用的。或者你可以用絕對定位的div製作你自己的。 – Paulpro 2013-04-22 00:43:39
對不起忘了添加我試圖不使用jQuery – 2013-04-22 00:53:20