HTML按钮在计算机上工作正常,但在手机和平​​板电脑上却没有

时间:2014-05-11 19:32:15

标签: javascript jquery html mobile razor

以下代码在计算机上运行良好,但是当我使用移动设备(Chrome)时,会出现问题。 问题-: 当我点击忽略按钮(按钮标题=“忽略”)时,它工作正常。但是当我点击锁定或点击答案(按钮)时,它们甚至无法在移动设备上点击。即使代码有效完全在计算机上,点击移动设备时出现问题。 这是Razor Code Snippet -

<div class="display-cont col-md-8">
            <div class="pull-right">
                @using (Html.BeginForm("Ignore","abc",FormMethod.Post))
                {

                 <input type="hidden" value="@Model.QuestionID" name ="QuestionID"/>
             <button type="submit" title="Ignore" class="btn btn-default btn-sm">
  <span class="glyphicon glyphicon-remove"></span> 
</button>
                }
</div>
            <h2>@Model.QuestionText</h2>
            @foreach(var Tag in Model.TagTables)
            {
                <div id="parallelogram">
                @Tag.TagName
                </div>
            }            
            @using (Html.BeginForm("Answer","abc",FormMethod.Post))
            {
                 <br />

                 <br />
            <input type="text" id="QuestionTxt" name="AnswerTxt" class="input-lg form-control" placeholder="Answer Here!" />
          <input type="hidden" id="PrivacyMode" name="PrivacyMode" value="1" />
                <input type="hidden" id="filename" name="filename" />

                 <br />
                <br />
                <div class="pull-left">

                    <span class="glyphicon glyphicon-ok" id="unlock">  Locked</span> &nbsp;&nbsp;&nbsp; 
                    <button type="button" class="btn btn-success lock" id="lockit" ><span class="fa fa-lock"></span> Lock</button>
                    <button type="button" class="btn btn-default lock" id="unlockit"><span class="fa fa-unlock"></span> Unlock</button>

                </div>
                <div class="pull-right">
                    <input type="hidden" name="filename" id="filename" />

                         <div class="btn-group">
  <button type="submit" class="btn btn-default" >Answer</button>

       </div>

                        </div>
                <input type="hidden" value="@Model.QuestionID" name ="QuestionID"/>
            }

        </div>

和Javascript。

<script type="text/javascript">
    $(document).ready(function () {

        $("#unlockit").hide();
        $("#unlock").hide();
    });
</script>


<script>
    $(".lock").click(function () {
        var mode = document.getElementById("PrivacyMode");
        var currentmode = document.getElementById("PrivacyMode").value;
        if (currentmode == 1) {
            mode.value = 3;
            $("#lockit").hide();
            $("#unlockit").show();
            $("#unlock").show();

        }
        else {
            mode.value = 1;
            $("#unlockit").hide();
            $("#unlock").hide();
            $("#lockit").show();
        }



});
    </script>

0 个答案:

没有答案
相关问题