How to disable a link button in jQuery Mobile?

后端 未结 6 1080
被撕碎了的回忆
被撕碎了的回忆 2021-02-05 14:46

I have a jQuery Mobile Beta 1 website with jQuery 1.6.1 link button like this:

TEST         


        
6条回答
  •  不思量自难忘°
    2021-02-05 14:54

    The a element does not have a property disabled. So defining one won't affect any event handlers you may have attached to it.

    example: http://jsfiddle.net/niklasvh/n2eYS/

    For a list of available attributes, have a look at the HTML 5 reference.

    To solve your problem, you could instead for example assign the disabled as data in the element:

    $('#subselection').data('disabled',true);

    and then in your event check if its set:

    if (!$(this).data('disabled'))

    example: http://jsfiddle.net/niklasvh/n2eYS/5/

提交回复
热议问题