Solved

How to open a modal window using Javascript

Posted on 2013-01-17
4
337 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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. …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

790 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