簡體   English   中英

IE以外的Windows.createPopup等效項

[英]Window.createPopup equivalent for otherthan IE

如何為Firefox,chrome和safari等瀏覽器獲取window.createpopup之類的工具提示?

我們可以使用div嗎?

在我的情況下,它應該顯示為工具提示。

如果我們使用如何將以下代碼更改為其他瀏覽器?

 var oPopupBody = oPopup.document.body;
    var sBody = "<span style='background-color:#ffffc4;border:2px solid black;height:100%;width:100%;'>";
    if (sLabel) {
        sBody += "<span style='font:10pt arial;font-weight:bold;padding-left:2px;text-align:center;width:100%;'>" + sLabel + "</span>";
    }
    sBody += "</span>";
    oPopupBody.innerHTML = sBody;
    oLink.title = '';
    oPopup.show(oLink.offsetWidth, -10, iW, iH, oLink);
    oLink.title = sLabel;

您可以為此使用jquery,大致如下:

$(element).hover(
  function(){
    $(this).find(child-element).show();
  },
  function(){
    $(this).find(child-element).hide();
  }
);

這樣的東西-http://jsfiddle.net/ajthomascouk/AShzJ/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM