在file1.js中,我读到:
// NOTE: initialize your app event handlers here, see file2.js for a simple event handler example
// TODO: configure following to work with both touch and click events (mouse + touch)
// see http://msopentech.com/blog/2013/09/16/add-pinch-pointer-events-apache-cordova-phonegap-app/
所以我用了一个wordpress的主题叫做: thalassa。
我去了并复制了portfolio.js代码。(注:除第一行外,我的portfolio.js完全相同)
portfolio.js:
$(window).load(function() {
/* ================ VERFIFY IF USER IS ON TOUCH DEVICE ================ */
if(is_touch_device()){
$(".portfolio-image").on('click', function(e){
这是JS,我试图将“触摸”更改为“单击”,但没有发生任何事情:
$(document).ready(function(){
var touch = $('#resp-menu');
var menu = $('.menu');
$(touch).on('click', function(e) {
e.preventDefault();
menu.slideToggle();
});
$(window).resize(function(){
va
store-models.js模型
(function ($) {
Category = Backbone.Model.extend({
//Create a model to hold friend atribute
name: null
});
Categories = Backbone.Collection.extend({
//This is our Friends collection and holds our Friend models
initialize: function (models, options) {
下面的代码为android/ipads等添加了触摸导航。它为幻灯片缩略图添加了滑动导航。这很有效,但在平板电脑上不能通过触摸点击缩略图。你可以在pc上点击它们,滑块就会变成平板电脑上适当的slide...not,就像触摸或“点击”什么也不做一样(滑动就行了)
JS小提琴
JS
$('#slider').anythingSlider({
navigationSize : 3,
// Callback when the plugin finished initializing
onInitialized: function(e, slider) {
var time
function handler1(){
$("#navi_touch").css("visibility","visible");
$("#navitouchbutton").css("background","red");
$("#navitouchbutton").one("click",handler2);
}
function handler2(){
$("