?
Solved

popup window access

Posted on 2010-08-16
2
Medium Priority
?
396 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 2000 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

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

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.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
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)
Suggested Courses

650 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