I have created a dialog box that appears when you click on an element on the page. The div box then appears with a huge box shadow to prevent the user from accessing the underlying (orginal) elements on the page. Except its doesnt, the user can still tab through the items under the .overlayme div
I have scaled my code down and writen this little example to demonstrate what i mean.
If you click on the first button and tab through the rest, when actually what i am trying to achieve is preveent the user from clicking on the first button and only being able to tab on the “eventually you”, “will get here” buttons.
My mark up is here
<html><head></head><body><input type="button" value="click me first" />
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<br/> <br/>
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<br/> <br/>
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<br/> <br/>
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<input type="button" value="now tab to me" />
<div class="overlayme">
<br/> <br/>
<input type="button" value="eventually you" />
<input type="button" value="will get here" /></div></body></html>
and my css is here
.overlayme input{ background-color:lightgrey; }
.overlayme {
max-width: 250px;
margin: 0 auto;
margin: 20px;
padding: 20px;
border-radius: 20px;
overflow: hidden;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 10000px rgba(0, 0, 0, 0.3);
position: relative;
background: white;}
input{
background-color:white;}
So basically in short .. The problem is that i can still access the underlying elements and i want them to be disabled and only be able to access the items on the .overlayme div.
Is it possible to disable this lower level with css or does this have to be a js thing?
Example here: http://jsfiddle.net/8BPMk/1/
Use this:
http://jsfiddle.net/gQEUx/
you need to add fixer div with absolute positioning and 100% width and heigth
and
and this fiddle – http://jsfiddle.net/gQEUx/1/, thanks to @AbstractChaos
so from this – http://www.w3.org/TR/html401/interact/forms.html#tabbing-navigation
and this – http://nemisj.com/focusable/
and this – http://msdn.microsoft.com/en-us/library/ie/ms534654%28v=vs.85%29.aspx
elements that can be tabindexed are:
msdn:
w3c:
and i haven’t read third article, think that would be enough already
EDIT: should do the job – http://jsfiddle.net/gQEUx/3/