简体   繁体   English

ASP.NET链接按钮避免在iOS中单击两次

[英]ASP.NET linkbutton avoid click twice in iOS

I have problem with iOS devices to active link, I need to tap twice on it. 我在使用iOS设备激活链接时遇到问题,我需要点击两次。

How to solve this with Jquery or other ways? 如何使用Jquery或其他方式解决此问题?

PS It happens only on tooltip hover. PS它仅在工具提示悬停时发生。

<asp:LinkButton ID="linkButtonDetails" runat="server" CommandName="Details" />

<a id="ctl00_zzzz" href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00_zzzz", "", true, "", "", false, true))'>Update details</a>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('a.TestingLink').live('click', function (e) {
                var obj = $(this);

                e.preventDefault();

                //Optional      $(obj).hide();

                $(obj).attr('disabled', 'disabled');

                $('#processing').show();

                WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(obj.data('href')));

                $(obj).removeAttr('disabled');
                $('#processing').hide();

                //Optional      $(obj).show();
            });

            function WebForm_PostBackOptions(a, b, c, d, e, f, g) {
                alert('WebForm_PostBackOptions');

                return true;
            };

            function WebForm_DoPostBackWithOptions(a) {
                alert('WebForm_DoPostBackWithOptions');
            };
        });
    </script>
</head>
<body>
    <span id="processing" style="font-size: 15px; font-weight: bolder; display: none;">Processing
        . . . </span>
    <br />
    <a id="ctl00_zzzz" href="" class="TestingLink" data-href='"ctl00_zzzz", "", true, "", "", false, true'>
        Update details1</a>
    <br />
    <a id="ctl00_zzza" href="" class="TestingLink" data-href='"ctl00_zzzz", "", true, "", "", false, true'>
        Update details2</a>
</body>
</html>

    enter code here

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM