| Server IP : 217.160.0.15 / Your IP : 216.73.216.227 Web Server : Apache System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux User : u37981780 ( 1696858) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /homepages/43/d124547881/htdocs/outofboundsldn.co.uk/wp-content/themes/new-blog_old/js/ |
Upload File : |
(function ($) {
'use strict';
// Sidenav focus Javascript
$('.sidenav').hide();
window.lastTabbable = '';
var findInsiders = function(elem) {
var tabbable = elem.find('input, button, a').filter(':visible');
var firstTabbable = tabbable.first();
if(tabbable.last().next().children().length == 0){
lastTabbable = tabbable.last();
}
else{
tabbable.last().focus(function(){
// alert('test');
$(this).addClass('show');
tabbable.last().next().addClass('show');
})
tabbable.last().next().children().last().focusout(function(){
tabbable.last().removeClass('show');
tabbable.last().next().removeClass('show');
});
lastTabbable = tabbable.last().next().children().last();
}
/*set focus on first input*/
firstTabbable.focus();
/*redirect last tab to first input*/
lastTabbable.on('keydown', function (e) {
if ((e.which === 9 && !e.shiftKey)) {
e.preventDefault();
firstTabbable.focus();
}
});
/*redirect first shift+tab to last input*/
firstTabbable.on('keydown', function (e) {
if ((e.which === 9 && e.shiftKey)) {
e.preventDefault();
lastTabbable.focus();
}
});
};
$('#sidenav-toggle').click(function(e){
e.preventDefault();
$('.sidenav').addClass('show');
$('.sidenav').show();
findInsiders($('.sidenav'));
});
$('#closebtn').click(function(e){
e.preventDefault();
$('.sidenav').removeClass('show');
$('.sidenav').hide();
$("#sidenav-toggle").focus();
});
})(window.jQuery);