加载页面时的Jquery Mobile Auto keyup。不工作

时间:2014-10-19 18:51:22

标签: jquery jquery-mobile

我在使用Jquery Mobile加载html页面时尝试执行自动键盘操作,但只有自动对焦正在运行且键盘部分不是。想知道如何自动执行Jquery移动密钥。感谢

    <script>
    $(document).on('pageshow', function(){ 

        $("#searchinput").keyup();
});

    </script>

Search.html

<!DOCTYPE html> 
<html> 
<body>
    <div data-role="page" id="home">
    <meta name="viewport" content="width=device-width, initial-scale=1"> 


<script type="text/javascript">
    $(document).ready(function(){
      $("#menu").mmenu({
         // options
      }, {
         // configuration
         offCanvas: {
            pageNodetype: "section"
         }
      });
   });
</script>
<script>
    $(document).on('pageshow', function(){ 
    $("#searchinput").focus();

});

    </script>
    <script>
    $(document).on('pageshow', function(){ 

        setTimeout(function()
    {
         $("#searchinput").keyup();
    },100)
});

    </script>

    <script type="text/javascript">
 $(document).on('pageinit', function() {
      $("#menu").mmenu({
         classes: "mm-light"
      });
   });
</script>

    <script>
        $("#menu").mmenu({
    searchfield: false,
    counters: true
});
         $("#my-button").click(function() {
$("#menu").trigger("open");
          });

        </script>
        <script type="text/javascript">
   $.fn.mmenu.debug = function( msg ) {
      console.log( msg );
   };
</script>



<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> 


    <div data-role="header" data-position="fixed" data-tap-toggle="false" data-theme=""> 

<a  id="my-button" data-transition="none">Back</a>




 <input type="search" id="searchinput" name="search-mini"  value="" data-mini="true" placeholder="Where?"/>




    </div>



       <div>


    <nav id="menu">
<ul>
    <li id="infinitytest.html">Home<br>
    <a>Test</a></li>
    <li>My account</li>
    <li>Setting</li>
    </ul>

</nav>






</div>


      <div>




    <div role="main" class="ui-content scroll">
        <ul data-role="listview" id="list"></ul>
    </div>





</div>






</div>


    </body>



</html>

0 个答案:

没有答案