Solved

How to open a modal window using Javascript

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Lazy load not working with masonry js 1 19
how can i select 4 30
how can i apply an assert arrayEqual function ? 2 26
replace link with jQuery 4 14
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

773 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