Click Me For A Modal
</button>
-<a href="http://some-url" data-reveal-id="myModal" data-reveal-ajax="true" role="button">
+<a href="http://some-url" data-reveal-id="myModal" data-reveal-ajax="true">
Click Me For A Modal
</a>
```
<h2 id="modalTitle">Awesome. I have it.</h2>
<p class="lead">Your couch. It is mine.</p>
<p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
- <button class="close-reveal-modal" aria-label="Close">×</button>
+ <a class="close-reveal-modal" aria-label="Close">×</a>
</div>
```
{{/markdown}}
<h2 id="modalTitle">Awesome. I have it.</h2>
<p class="lead">Your couch. It is mine.</p>
<p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
- <button class="close-reveal-modal" aria-label="Close">×</button>
+ <a class="close-reveal-modal" aria-label="Close">×</a>
</div>
\ No newline at end of file
{{#markdown}}
```html
-<a href="#" data-reveal-id="myModal" role="button">Click Me For A Modal</a>
+<a href="#" data-reveal-id="myModal">Click Me For A Modal</a>
```
{{/markdown}}
<p>Reveal makes these very easy to summon and dismiss. The close button is simply an anchor with a unicode character icon and a class of <code>close-reveal-modal</code>. Clicking anywhere outside the modal will also dismiss it.</p>
<p>Finally, if your modal summons another Reveal modal, the plugin will handle that for you gracefully.</p>
<p><a href="#" data-reveal-id="secondModal" class="secondary button">Second Modal...</a></p>
- <button class="close-reveal-modal" aria-label="Close">×</button>
+ <a class="close-reveal-modal" aria-label="Close">×</a>
</div>
<div id="secondModal" class="reveal-modal" data-reveal aria-labelledby="secondModalTitle" aria-hidden="true" role="dialog">
<h2 id="secondModalTitle">This is a second modal.</h2>
<p>See? It just slides into place after the other first modal. Very handy when you need subsequent dialogs, or when a modal option impacts or requires another decision.</p>
- <button class="close-reveal-modal" aria-label="Close">×</button>
+ <a class="close-reveal-modal" aria-label="Close">×</a>
</div>
<div id="videoModal" class="reveal-modal large" data-reveal aria-labelledby="videoModalTitle" aria-hidden="true" role="dialog">
<iframe width="1280" height="720" src="//www.youtube-nocookie.com/embed/wnXCopXXblE?rel=0" frameborder="0" allowfullscreen></iframe>
</div>
- <button class="close-reveal-modal" aria-label="Close">×</button>
+ <a class="close-reveal-modal" aria-label="Close">×</a>
</div>
<!-- Reveal Modals end -->
```
<p>Reveal makes these very easy to summon and dismiss. The close button is simply an anchor with a unicode character icon and a class of <code>close-reveal-modal</code>. Clicking anywhere outside the modal will also dismiss it.</p>
<p>Finally, if your modal summons another Reveal modal, the plugin will handle that for you gracefully.</p>
<p><a href="#" data-reveal-id="secondModal" class="secondary button">Second Modal...</a></p>
- <button class="close-reveal-modal" aria-label="Close">×</button>
+ <a class="close-reveal-modal" aria-label="Close">×</a>
</div>
<div id="secondModal" class="reveal-modal" data-reveal aria-labelledby="secondModalTitle" aria-hidden="true" role="dialog">
<h2 id="secondModalTitle">This is a second modal.</h2>
<p>See? It just slides into place after the other first modal. Very handy when you need subsequent dialogs, or when a modal option impacts or requires another decision.</p>
- <button class="close-reveal-modal" aria-label="Close">×</button>
+ <a class="close-reveal-modal" aria-label="Close">×</a>
</div>
<div id="videoModal" class="reveal-modal large" data-reveal aria-labelledby="videoModalTitle" aria-hidden="true" role="dialog">
<iframe width="1280" height="720" src="//www.youtube-nocookie.com/embed/wnXCopXXblE?rel=0" frameborder="0" allowfullscreen></iframe>
</div>
- <button class="close-reveal-modal" aria-label="Close">×</button>
+ <a class="close-reveal-modal" aria-label="Close">×</a>
</div>
<!-- Reveal Modals end -->
\ No newline at end of file
<p>Or you can call one right after the other:</p>
{{#markdown}}
```html
-<div class="reveal-modal" id="first-modal" data-reveal>
+<div class='reveal-modal' id='first-modal' data-reveal>
I'm the firstborn!
- <a class="open-second" role="button" href="#">Click me!</a>
+ <a class='open-second'>Click me!</a>
</div>
- <div class="reveal-modal" id="second-modal" data-reveal>
+ <div class='reveal-modal' id='second-modal' data-reveal>
I'm the secondborn!
- <a class="close" role="button" href="#">Close modal</a>
+ <a class='close'>Close modal</a>
</div>
- <a class="open-first" href="#">Click me!</a>
+ <a class='open-first'>Click me!</a>
```
{{/markdown}}
variable_height: false, // Does the slider have variable height content?
swipe: true,
before_slide_change: noop, // Execute a function before the slide changes
- after_slide_change: noop, // Execute a function after the slide changes
- prev_text: 'Previous slide', // (Title) text for arrow to previous slide
- next_text: 'Next slide' // (Title) text for arrow to next slide
+ after_slide_change: noop // Execute a function after the slide changes
}
});
```
## Accessibility
-<p class="panel">This component is not yet fully accessible. While it is usable via the keyboard, it has to be checked if additional (ARIA) attributes can enhance the components accessibility. The examples above show how to implement accessible modals using some of those attributes.
-<br />Please note that you should either add the tabindex- or the href-attribute to anchors to make them fully utilizable by keyboards.</p>
+<p class="panel">This component is not yet fully accessible. While it is usable via the keyboard, it has to be checked if additional ARIA attributes can enhance the components accessibility.</p>
***
}
if (settings.navigation_arrows) {
- container.append($('<a href="#" title="'+settings.prev_text+'"><span></span></a>').addClass(settings.prev_class).append('<span class="visuallyhidden">'+settings.prev_text+'</span>'));
- container.append($('<a href="#" title="'+settings.next_text+'"><span></span></a>').addClass(settings.next_class).append('<span class="visuallyhidden">'+settings.next_text+'</span>'));
+ container.append($('<a href="#"><span></span></a>').addClass(settings.prev_class));
+ container.append($('<a href="#"><span></span></a>').addClass(settings.next_class));
}
if (settings.timer) {
variable_height : false,
swipe : true,
before_slide_change : noop,
- after_slide_change : noop,
- prev_text: 'Previous slide',
- next_text: 'Next slide'
+ after_slide_change : noop
},
init : function (scope, method, options) {
S(document)
.on('click.fndtn.reveal', this.close_targets(), function (e) {
e.preventDefault();
-
if (!self.locked) {
var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init') || self.settings,
bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0];
$.ajax(ajax_settings);
}
}
-
- // trap the focus within the modal while tabbing
- self.S(modal).on('keydown', function(e) {
- var visibleFocusableElements = modal.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function() {
- if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) return false; //only have visible elements and those that have a tabindex greater or equal 0
- return true;
- });
- if (e.keyCode === 9) { // tab is pressed
- if (e.shiftKey && self.S(modal).find(':focus').is(visibleFocusableElements.eq(0))) { // left modal downwards, setting focus to first element
- visibleFocusableElements.eq(-1).focus();
- e.preventDefault();
- } else if (!e.shiftKey && self.S(modal).find(':focus').is(visibleFocusableElements.eq(-1))) { // left modal downwards, setting focus to first element
- visibleFocusableElements.eq(0).focus();
- e.preventDefault();
- }
- }
- });
self.S(window).trigger('resize');
},
context.locked = false;
el.trigger('opened.fndtn.reveal');
})
- .addClass('open')
- .focus();
+ .addClass('open');
}, settings.animation_speed / 2);
}
context.locked = false;
el.trigger('opened.fndtn.reveal');
})
- .addClass('open')
- .focus();
+ .addClass('open');
}, settings.animation_speed / 2);
}
this.locked = false;
- return el.show().focus();
+ return el.show();
},
to_back : function(el) {
$reveal-close-side: rem-calc(22) !default;
$reveal-close-color: $base !default;
$reveal-close-weight: $font-weight-bold !default;
-$reveal-close-padding: 0 !default;
-$reveal-close-background-color: transparent !default;
-$reveal-close-border: none !default;
// We use this to set the default radius used throughout the core.
$reveal-radius: $global-radius !default;
line-height: 1;
position: absolute;
top: $reveal-close-top;
- padding: $reveal-close-padding;
- background-color: $reveal-close-background-color;
- border: $reveal-close-border;
#{$opposite-direction}: $reveal-close-side;
}
z-index: $z-index-base - 2;
}
- .#{$close-reveal-modal-class} {
- @include reveal-close;
- }
+ .#{$close-reveal-modal-class} { @include reveal-close; }
}
}
}