Pop up windows can be easily implemented using JQuery-UI library. Most interesting thing is,
it is..
- Movable
- Re-sizable
- Download the JQuery and JQuery UI libraries. (You can download JQuery-UI from here.)
- Add reference to JQuery, JQuer-UI (both JavaScript and CSS)
EX:
<link rel="stylesheet" href="jquery-ui.css"> <script src="jquery-1.11.3.js"></script> <script src="jquery-ui.js"></script>
- Then call JQuery UI dialog() method on a element that need to be displayed as pop up window
<div id="dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> <script> $(function() { $( "#dialog" ).dialog(); }); </script>
Example 1
Here is a simple complete example from JQuery UI site.<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Dialog - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#dialog" ).dialog();
});
</script>
</head>
<body>
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
</body>
</html>
Example 2
Here is a complete example for making a customized pop up window with a title bar and a content area.
This example load a separate HTML page ("popup.html") to a div (div with class "dialog-modal") with Open method. Different API s are provided to customize pop up as you want by JQuery UI team.(show and hide APIs also used in this example)
<html>
<head>
<link rel="stylesheet" href="jquery-ui.css">
</head>
<body>
<h3>Making A Pop Up window</h3>
<input type="button" value="Click to pop Up menu" onclick="popupView()">
<div class="dialog-modal" style="display: none;">
</div>
<script src="jquery-1.11.3.js"></script>
<script src="jquery-ui.js"></script>
<script>
function popupView() {
$(".dialog-modal").dialog({
open: function () {
$(this).load('popup.html', function () {
$(this).dialog('open');
});
},
show: {
effect: "fade",
duration: 400
},
hide: {
effect: "fade",
duration: 400
}
});
}
</script>
</body>
</html>
Thank you very much for your good information UI Online course
ReplyDeletegreat
ReplyDeleteReally nice post.provided a helpful information.I hope that you will post more updates like this
ReplyDeleteUI Design Course
Really nice post.provided a helpful information.I hope that you will post more updates like this
ReplyDeleteUI Design Course
Awesome Posts...The information's are very Helpful, Thanks For Sharing with us...
ReplyDeleteJava training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery
Thanks for sharing this wonderful content.its very useful to us.This is incredible,I feel really happy to have seen your webpage.I gained many unknown information, the way you have clearly explained is really fantastic.keep posting such useful information...
ReplyDeleteSalesforce Training in Chennai
Salesforce Online Training in Chennai
Salesforce Training in Bangalore
Salesforce Training in Hyderabad
Salesforce training in ameerpet
Salesforce Training in Pune
Salesforce Online Training
Salesforce Training
Thank you for sharing such a nice and interesting blog with us. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information.
ReplyDeleteJava training
AWS Training courses and certification
FullStack development training
Dot net MVC training
I am completed training last week. It was a very good 5 month session which included excellent training content, live examples, mock exams etc. Thanks to the trainer and Simplilearn.
ReplyDeletePython Training in Gurgaon
Devops Training in Gurgaon
Machine Learning Training in Gurgaon
Data Analytics Training in Gurgaon