Solved

popup window access

Posted on 2010-08-16
2
387 Views
Last Modified: 2012-05-10
how to move the focus to close link after tabbing from cancel button?
how to move the close link to the right corner?
how to make the background of the whole page gray like real modal window when the modal window come up?
how to make the popup to close when escape key is pressed?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript">
  $(document).ready(function() {
    $("#dialog").dialog({
      autoOpen: false,
      modal: true,
      buttons: {
        "Ok": function() {
          window.location.href="http://www.yahoo.com";
        },
        "Cancel": function() {
          $(this).dialog("close");
        }
      }
    });
  });
  
  function OpenDialog() {
    $('#dialog').dialog('open');
  };
</script> 
</head>
<body>
<a href="javascript:OpenDialog();">exit</a> 
<div id="dialog" style="border:1px solid blue;display:none;background-color:gray"><p>Are you sure?</p></div>
</body>
</html>

Open in new window

0
Comment
Question by:yingwho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 500 total points
ID: 33452127
Make sure you have a proper stylesheet : put this in the head section of your HTML document
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />

Check out http://jqueryui.com/themeroller/ where you pick/create a theme.

Escape key and tab key are working the way you described...
0
 

Author Closing Comment

by:yingwho
ID: 33455536
great. thanks
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
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…

719 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