开发者

FireFox extension. How i can add overlay into content area of window

开发者 https://www.devze.com 2022-12-24 06:15 出处:网络
My Problem in a subject. For Example: how can i dev my own Alert Pop-ups I think, its possible with overlays, but 开发者_运维问答i dont know how. My suggestion would be to use a combination of javascr

My Problem in a subject. For Example: how can i dev my own Alert Pop-ups I think, its possible with overlays, but 开发者_运维问答i dont know how.


My suggestion would be to use a combination of javascript and CSS. The key to the pop-up will be using a z-index in the CSS that puts it in front of the rest of the page content.

The javascript would just be used to activate and deactivate this section. You could also set up some other CSS classes to darken the rest of the page content, and apply those classes in the same javascript function.


What about ol'good?

<script type="text/javascript">
   alert("Hello, I'm a pop-up!");
</script>

Eventually, you could use jQuery UI Dialog module: http://jqueryui.com/demos/dialog/

Edit: I think you should also say if you are interested in JavaSctipt OR XUL based solution.

Edit 2:

If you want to use XUL, check out this links:

  • https://developer.mozilla.org/en/XUL_Overlays
  • https://developer.mozilla.org/en/Building_an_Extension
  • http://www.gmacker.com/web/content/tutorial/firefox/firefoxtutorial.htm

I found them very useful when I was working on my own extensions.

Truly, all you need is a:

<box id="myBox"> content here </box>

plus some logic to open it.


My suggestion would be to use BlockUI , its light-weight and very easy to use.

0

精彩评论

暂无评论...
验证码 换一张
取 消