2016-03-05 23 views
-4

我已經在我的網站上實現了touch-punch插件,但我仍然無法將觸摸功能用於我的簽名功能。當我在Edge上使用它時,觸摸功能可能會在停止前工作一秒。另外,對於普通的Internet Explorer而言,它的效果非常好,但Chrome和Firefox根本無法使用觸控功能。爲什麼Touch-Punch插件無法在我的網站上運行?

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/south-street/jquery-ui.css" rel="stylesheet"> 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js"></script> 
<link href="<?php echo plugins_url(); ?>/booking/css/jquery.signature.css" rel="stylesheet"> 
<script src="<?php echo plugins_url(); ?>/booking/js/jquery.signature.js"></script> 
<script src='https://javascriptbase64.googlecode.com/files/base64.js' type='text/javascript'></script> 
<script src="jquery.ui.touch-punch.min.js"></script> 

簽字代碼:

<script> 
    $(function() { 
     $('#sig'+"<?php echo $row->bookingid; ?>").signature({ 
      guideline: true, 
      guidelineOffset: 25, 
      guidelineIndent: 20, 
      guidelineColor: '#ff0000', 
       change: function(event, ui) { 
        var jsonval = $(this).signature('toJSON'); 
        $("#signcanvas"+"<?php echo $row->bookingid; ?>").val(jsonval); 
    } 
      }); 
    }); 
    </script> 
+1

爲什麼這不是在你的網站工作是不是會幫助未來的人特別是因爲一個簡單的錯誤...這最好是刪除這樣的問題,而不是回答 –

回答

-1

所以我對觸摸衝插件路徑,是不正確的。找到CPanel中的jquery.ui.touch-punch.min.js文件的正確路徑後,我更改了代碼中的路徑,並能夠使用觸摸功能。還要確保定義了腳本的類型。

例如:添加type=text/javascript也是插件運行所必需的。

相關問題