Solved

How to open a modal window using Javascript

Posted on 2013-01-17
4
338 Views
Last Modified: 2013-01-31
Hi

I am opening a new window using window.open() in JavaScript.
How can i make this window Modal?

Right now I am using


 var OpenWindow = function (URL) {
            window.open(URL, null, "height=680,width=980,status=no,toolbar=no,menubar=no,location=no");
        }

Thanks
0
Comment
Question by:Aspnet_9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 38787624
0
 

Author Comment

by:Aspnet_9
ID: 38787668
Is jquery the only way, can we do it with simple JavaScript?
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 38787729
check the one here : http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_26163793.html

remove mootools plugin and replace the javascript code by :
function $(id) { return document.getElementById(id); }
window.onload = function() {
	$('fb-close').onclick = function() { $('fb-modal').style.display = "none";  };
	$('fb-trigger').onclick =  function() { $('fb-modal').style.display = "block"; };
};

Open in new window

0
 

Author Closing Comment

by:Aspnet_9
ID: 38840929
ok
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML auto refresh to another site 4 30
Triple line in an alert message 4 24
Table style position to the left 8 26
How do I post more than 1 item to php backend 24 31
This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question