jQuery mobile (click event)

后端 未结 2 507
礼貌的吻别
礼貌的吻别 2021-01-13 13:29

I\'m developing smartphone hybrid applications.

I\'m trying to hide/show a

with slideDown/slideUp.

When I

2条回答
  •  余生分开走
    2021-01-13 13:46

    I would suggest using on() instead of bind()

    And since youre doing this:

    var btnMenuDyn = $('a.btnMenuDyn')
    

    btnMenuDyn is a jquery dom element, so change this:

    if ($(menuDyn).hasClass("menuDynHide"))
    

    to this

    if (menuDyn.hasClass("menuDynHide"))
    

    And preferably declare jquery dom elements like this:

    var $btnMenuDyn = $('a.btnMenuDyn')
    

提交回复
热议问题