Solved

popup window access

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now