开发者

Jquery facebox disabling button

I am trying to disable the fillin button and enable it later. I thought i could just remove the attr href and rel from the anchour and add them again when i want it enabled but it still works even a开发者_运维问答fter i remove the href and rel. It must initialise before they are removed

$('#fillin').fadeTo("fast", .5).removeAttr("href"); 
$('#fillin').fadeTo("fast", .5).removeAttr("rel");

$('#fillin').attr('href', '#info');
$('#fillin').attr('rel', 'facebox');



$('a[rel*=facebox]').facebox({
        loadingImage : 'images/loading.gif',
        closeImage   : 'images/closelabel.png'
      });

<a id="fillin" href="#info" rel="facebox"><img border="0" src="images/getprice.png"/></a>

Thanks

Lee


To disable:

$('#fillin').bind('click', false);

To reenable:

$('#fillin').unbind('click', false);

This may or may not work depending on how Facebox attaches it's event handlers.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜