// I understand nothing in JS and work empathically :-)
// This one has been taken from somewhere. Attempts to improve fail :(
// The speed of one transition (fadeIn or fadeOut).
// Full execution time will be:
// (browser navigation time) + speed * 2;
// You can set this to slow, medium, fast, or number of ms.
var speed = 'slow';
$('html, body').hide();
$(document).ready(function() {
$('html, body').fadeIn(speed, function() {
$('a[href], button[href]').click(function(event) {
var url = $(this).attr('href');
if (url.indexOf('#') == 0 || url.indexOf('javascript:') == 0 || url.indexOf('http') == 0) return;
event.preventDefault();
$('html, body').fadeOut(speed, function() {
window.location = url;
});
});
});
});
排除target="_blank"
属性的选项应该是什么样的?我知道它靠近ors(||
):-),但是它的完美语法是什么?