点击时禁用的按钮隐藏头 [英] Disabled button hides header when clicked

查看:94
本文介绍了点击时禁用的按钮隐藏头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很奇怪的问题...

当我点击一个按钮,被禁用,头滚动起来......(下面演示)

为什么出现这种情况?

演示

下面是code:

 < D​​IV数据角色=页面数据主题=B@TempData [DataUrl]>
< D​​IV数据角色=头的数据位=固定>
    MyApp的
< / DIV>
< D​​IV数据角色=内容>
    < D​​IV的风格=高度:300像素>内容< / DIV>
        < D​​IV CLASS =controlGroupButtons数据角色=controlgroup>
            &所述;类别=Button1的数据角色=按钮> Marcar&下; / A>
            &所述;类别=Button2的数据角色=按钮> Desmarcar&下; / A>
        < / DIV>
    < / DIV>

  $(Button1的,.Button2)buttonMarkup()addClass(UI-已禁用)。


解决方案

只需添加数据自来水切换=FALSE来的头DIV和问题会消失!因为当按钮被禁用,点击就会触发事件。一旦点击事件触发时,它会显示/隐藏标题。

I'm having a very strange issue...

When I click in a button that is disabled, the header scrolls up... (demo below)

Why this happen?

Demo

Here is the code:

<div data-role="page" data-theme="b" @TempData["DataUrl"]>
<div data-role="header" data-position="fixed">
    MyApp
</div>
<div data-role="content">
    <div style="height:300px">Content</div>
        <div class="controlGroupButtons" data-role="controlgroup">
            <a class="Button1" data-role="button">Marcar</a>
            <a class="Button2" data-role="button">Desmarcar</a>
        </div>
    </div>

$(".Button1, .Button2").buttonMarkup().addClass("ui-disabled"); 

解决方案

Just add data-tap-toggle="false" to the header div and the problem will vanish! Because when the buttons are disabled, the click will be trigger tap event. Once Tap event is triggered, it will show/hide header.

这篇关于点击时禁用的按钮隐藏头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆