Open an overlay while nextpage is loading
Trying to open an overlay (with JqueryTools) with loading message before the page changes, can't find how to use the href attribute of my trigger (i'm using a class .btn_menu for multiple button)
HTML
<div class='btn_menu'>
<a class='modalInput' rel='#loading' href="a_mailling.php"></a>
</div>
JS
$(function() {
var triggers = $(".btn_menu a").overlay({
expose: {
color: '#000',
loadSpeed: 200,
opacity: 0.9
},
closeOnClick: false,
onBeforeLoad: function(){ //right ?
window.location = //need to get href attribute of clicked trigger
}
});
var buttons = $("#loading button").click(function(e)开发者_开发知识库 {
var yes = buttons.index(this) === 0;
});
});
I haven't use jQuery tools much, but you could structure it a little differently to cache each <a>
.
$(function(){
$('.btn_menu a').each(function(){
var url=this.href;
$(this).overlay({
//other options
onBeforeLoad: function(){
//do something with url
}
});
});
});
精彩评论