?
Solved

popup window access

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

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
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…
The viewer will learn how to dynamically set the form action using jQuery.
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…
Suggested Courses

771 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