Created
July 12, 2016 21:10
-
-
Save nwhobart/7da1ceda7a00bdb0fa38157515a712ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hide on click. | |
if (config.hideOnClick) { | |
$this.find('a') | |
.css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)'); | |
$this | |
.on('click', 'a', function(event) { | |
var $a = $(this), | |
href = $a.attr('href'), | |
target = $a.attr('target'); | |
if (!href || href == '#' || href == '' || href == '#' + id) | |
return; | |
// Cancel original event. | |
event.preventDefault(); | |
event.stopPropagation(); | |
// Hide panel. | |
$this._hide(); | |
// Redirect to href. | |
window.setTimeout(function() { | |
if (target == '_blank') | |
window.open(href); | |
else | |
window.location.href = href; | |
}, config.delay + 10); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment