0





97
1

How can i set my slideToggle to be hidden until it receives focus from a skip link click?

The skip-link targeting jquery

$(document).ready(function () {
    $('#skip-link').click(function (e) {
        e.stopPropagation();
        var hash = $(this).attr("href").slice(1);
        $("#" + hash).focus();
        return false;
    });
});

the slide-toggle Jquery

$(document).ready(function () {
    $('.main-content').focus(function () {
        $("#anchor").slideToggle();
    });
});
Question author Joshua | Source

0


1

After tinkering with the issue for a while, I found a work around that starts with the hidden anchor tag, and opens on focus.

$('.main-content').focus(function () {
    $("#anchor").delay(3000).fadeToggle();
});

This allows for both a slow close, and shows on command. This way, it will display correctly on the page, and works with ajax.

Answer author Joshua

Ask about this question here!