Jquery mobile 如何使用jquery mobile使用不同的设备返回页面顶部

Jquery mobile 如何使用jquery mobile使用不同的设备返回页面顶部,jquery-mobile,Jquery Mobile,我是jquery mobile的新手。我使用从stackoverflow获得的代码。我的问题是,这个解决方案在三星和其他手机上运行良好,但在iphone和sonyericsson上不起作用。请帮助任何人 我想返回页面顶部,同时单击链接向下滚动页面底部 这是我的密码: <a id="uptotop" class="ui-btn-right" data-icon="arrow-u" data-theme="a">▲TOPにもどる </a>

我是jquery mobile的新手。我使用从stackoverflow获得的代码。我的问题是,这个解决方案在三星和其他手机上运行良好,但在iphone和sonyericsson上不起作用。请帮助任何人

我想返回页面顶部,同时单击链接向下滚动页面底部

这是我的密码:

  <a id="uptotop"  class="ui-btn-right" data-icon="arrow-u" data-theme="a">▲TOPにもどる    </a>
                     <script type="text/javascript">
    $('div').live('pagebeforecreate',function(event, ui){
      $('#uptotop').live('click',function() {
    $('html, body').animate({scrollTop: '0px'}, 800);
           });

         });
</script>  
▲顶部にもどる    
$('div').live('pagebeforecreate',函数(事件,ui){
$('#Uptop').live('单击',函数()){
$('html,body').animate({scrollTop:'0px'},800);
});
});

使用一个简单的锚怎么样?例如:

<!DOCTYPE html>
<html>
  <head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Test</title>
  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
  <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
  <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>

<body>
  <div data-role="page">
    <div data-role="header">
      <h1><a name="top"></a>Header</h1>
    </div> <!-- /header -->

    <div data-role="content">
      <p>lots of content here...<br>scroll down to find the button...
        <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
        <a href="#top" target="_top" data-role="button">Back to top of page ...</a>
      </p>
    </div> <!-- /content -->
  </div> <!-- /page -->

</body>
</html>

试验