Solved

Preventing tabs in a modal overlay

Posted on 2013-11-11
1
679 Views
Last Modified: 2013-11-12
I'm using a Telerik control which sets a modal overlay across a page while a modal dialog is showing.

Here is the div for the overlay:

<div unselectable="on" class="TelerikModalOverlay" style="position: absolute; left: 0px; top: 0px; z-index: 7999; background-color: rgb(170, 170, 170); opacity: 0.5; width: 1147px; height: 969px;"></div>

Open in new window


The trouble is it is still possible to tab onto some of the elements on the page below - is there some extra attribute I can set on this div that will prevent the user being able to tab off the modal dialog and onto the page below?
0
Comment
Question by:purplesoup
[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
1 Comment
 
LVL 30

Accepted Solution

by:
Alexandre Simões earned 500 total points
ID: 39640907
You can handle the elements focus outside the popup.
If an element gets the focus and it's outside the popup, put the focus on the first element of the popup.

In the following demo I simulate this with 2 areas.
Area two behaves like your popup, and the button toggles the area visibility.
While area 2 is visible you won't be able to focus outside its controls.
http://jsfiddle.net/GF7Ba/4/
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

752 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