Solved

popup window access

Posted on 2010-08-16
2
381 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
converting document.write() to innerHTML 7 79
modify change color of text 9 48
Make Float not to Wrap 15 64
Make icons act like add/minus for qtys 6 40
The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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

737 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