Solved

How to open a modal window using Javascript

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now