首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在iPad上,gruntjs -jquery-ui-touch-冲床不起作用。

在iPad上,gruntjs -jquery-ui-touch-冲床不起作用。
EN

Stack Overflow用户
提问于 2014-01-01 10:31:05
回答 1查看 1.4K关注 0票数 0

我开发了一个应用程序,使用reuire、主干、jquery、jquery、jquery触摸穿孔和锤子。

该应用程序由两个部分组成:可拖动的<li>元素和可下垂区域的<div>。用例是拖动<li>并将其拖放到<div>上。<div>是一个具有缩放和pan功能的时间线。

变焦和pan是使用hammer.js实现的,可以很好地在iPad上工作。对于桌面浏览器,它是使用mousewheelmousedown事件实现的。

当我使用grunt dist:local -force构建应用程序时,它在桌面和iPad浏览器上工作得很好。但是当我使用grunt dist:prod -force构建它时,它在桌面浏览器上工作得很好,但是停止了在iPad上拖动jquery元素。

请在配置文件下面找到。

代码语言:javascript
复制
requirejs.config({
  shim: {
    jquery: {
      exports: '$'
    },
    underscore:{
        exports: '_'
    },
    backbone:{
        deps    : ['jquery', 'underscore'],
        exports : 'Backbone'
    },
    createjs: {
        exports : 'createjs'
    },
    d3:{
        deps    : ['jquery', 'underscore'],
        exports : 'd3'
    },
    sinon: {
        exports : 'sinon'
    },
    'jquery-ui': {
        deps   : ['jquery'],
        exports : '$'
    },
    'jquery-ui-core': {
        deps   : ['jquery'],
        exports : '$'
    },
    'jquery-ui-widget': {
        deps   : ['jquery-ui-core'],
        exports : '$'
    },
    'jquery-ui-mouse': {
        deps   : ['jquery-ui-widget'],
        exports : '$'
    },
    'jquery-ui-slider': {
        deps   : ['jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse'],
        exports : '$'
    },
    'touch-punch': {
       deps   : ['jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse'],
       exports : '$'
    },

    'transitjs' : {
        deps: ['jquery'],
        exports: '$'
    },
    hammerjs: {
        exports : 'Hammer'
    }
},
  paths: {
    env         : 'environment/local',

    text        : '../../../bower_components/requirejs-text/text',

    jquery      : '../../../bower_components/jquery/jquery',
    'jquery-ui' : "../../../bower_components/jquery-ui/ui/jquery-ui",
    'jquery-ui-core' : "../../../bower_components/jquery-ui/ui/jquery.ui.core",
    'jquery-ui-widget' : "../../../bower_components/jquery-ui/ui/jquery.ui.widget",
    'jquery-ui-mouse' : "../../../bower_components/jquery-ui/ui/jquery.ui.mouse",
    'jquery-ui-slider': "../../../bower_components/jquery-ui/ui/jquery.ui.slider",
    underscore  : '../../../bower_components/underscore/underscore',
    backbone    : '../../../bower_components/backbone/backbone',
    check       : '../../../bower_components/check-js/check.min',
    d3          : '../../../bower_components/d3/d3.min',
    createjs    : '../../../bower_components/createjs/index', 


    'astro-lib': "../../../bower_components/astro-lib/app/scripts/astro-lib",
    'histogramjs': "../../../bower_components/histogramjs",
    'transitjs': "../../../bower_components/transitjs/jquery.transit",   
    'sinon'       : "../../../test/libs/sinon-1.4.2",

    'hammerjs'    : "../../../bower_components/hammerjs/dist/hammer.min",

    'touch-punch':"../../../bower_components/jqueryui-touch-punch/jquery.ui.touch-punch"//,

    //'polyfill-typedarray'    : "../../../bower_components/polyfill/typedarray"
  }
});

bower.json

代码语言:javascript
复制
{
  "name": "timescaler",
  "version": "0.1.0",
  "dependencies": {
    "jquery": "1.8.3",
    "requirejs": "~2",
    "requirejs-text": "~2",
    "mocha": "~1.6",
    "chai": "~1.3",
    "chai-jquery": "~1.1.1",
    "almond": "~0.2",
    "backbone": "~0.9.2",
    "jquery-ui": "~1.10.3",
    "underscore": "~1.4.2",  
    "check-js": "~0.1.0",
    "flat-ui-official": "",
    "font-awesome": "~3.2.1",
    "d3":"~3.2.7",
    "createjs": "http://code.createjs.com/createjs-2013.02.12.min.js",
    "jqueryui-touch-punch": "",    
    "hammerjs": "~1.0.5",
    "polyfill": "https://github.com/inexorabletash/polyfill.git",
    "astro-lib": "git@github.com:SmartSparrow/astro-lib.git",
    "pipit": "https://github.com/SmartSparrow/pipit-js.git"
  }
}

jquery触摸-打孔器在grunt dist:prod -force上有什么问题吗?为什么它对桌面浏览器上的grunt dist:local -force很好呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-01-08 08:43:49

这是命令在页面上添加jquery-uitouch-punch的问题。我在touch-punch之前添加了jquery-ui,因此它在grunt dist:prod中不起作用。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20867680

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档