Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to open a modal window using Javascript

Posted on 2013-01-17
4
Medium Priority
?
357 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 83

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 83

Accepted Solution

by:
leakim971 earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…
Suggested Courses

886 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