弹出窗口的JavaScript [英] javascript for pop up window

查看:62
本文介绍了弹出窗口的JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个禁用弹出窗口和背景的网页..

假设我单击立即注册"链接,然后在同一页面上打开google Docs表单,同时弹出窗口和后台页面禁用......
有什么办法吗?
请帮助我,这是Web编程的新手..

i want to make a web page with pop window and background disable..

suppose i click on link "Register NOW" then google Docs form open on same page with pop up and background page disable ......
is there any way??
plz help i m new to web programming..

推荐答案

如果您是Web编程的新手,请考虑一下: .microsoft.com/visualstudio/en-us/lightswitch> LightSwitch [ ^ ]

这可能会节省您很多精力.

最好的问候
Espen Harlinn
If you are new to web programming, consider having a look at: LightSwitch[^]

It will probably save you a lot of effort.

Best regards
Espen Harlinn


这不是真正的弹出窗口.这是一个jQuery灯箱.如果您将jquery和google的"lightbox"包括在内,则会发现很多示例,但总体而言,如果您不熟悉Web编程,我建议您在学习ASP.NET MVC之后再学习JavaScript. .如果您要学习其他内容,请放弃并学习ASP.NET MVC.

此处 [
This is not a real popup. It''s a jquery lightbox. If you include jquery and google ''lightbox'' you''ll find lots of examples, but overall if you''re new to web programming, I''d suggest you learn javascript AFTER you''ve learned ASP.NET MVC. If you''re learning something else, abandon it and learn ASP.NET MVC.

Here[^] is the site for the lightbox plug in. You should be able to just copy the code from the site ( you will need to include the right libraries, and probably download them ). It doesn''t need any sort of server side code, you can do it in pure HTML.


可以通过在JS中动态创建一个div来完成,例如:

It''s done by creating an overlaying div on the fly in JS, like:

var gab = document.createElement('div');
  gab.setAttribute('id', 'OVER');
  gab.innerHTML='<div class="overlay"><h1>hello</h1></div>';
  document.body.appendChild(gab);


使用CSS类,如


use a CSS class like

#OVER{width:100%; height:100%; left:0;/*IE*/ top:0; text-align:center; z-index:5; position:fixed; background-color:#fff;}
.overlay {width:100%; z-index:6; left:0;/*IE*/ top:30%; font-color:#cdcdcd; font-size:0.8em; text-align:center; position:fixed; background-color:#000;}


这篇关于弹出窗口的JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆