开发者

Open an overlay while nextpage is loading

开发者 https://www.devze.com 2022-12-16 16:09 出处:网络
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)

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
      }
    });
  });
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号