tearsinchina
V2EX  ›  问与答

求个在android的浏览器下,连续几个单元格连线的js代码,研究了3天了,没有一点儿进展

  •  
  •   tearsinchina · Aug 1, 2012 · 3395 views
    This topic created in 5073 days ago, the information mentioned may be changed or developed.
    情景如下:

    26个字母打散,分布在26个单元格里,用户使用android下的浏览器打开这个页面后 ,当用户用手指选中其中一个字幕并按住不放然后移动手指,这样,手指移动过的单元格都会触发一个事件。


    问题:

    用过jqueryMobile的VMouseMove和vmouseover了,用户只有在再次放下手指的时候才会触发,这意味着按住不放连续移动,是触发不了这个事件的,



    求高手
    5 replies    1970-01-01 08:00:00 +08:00
    WarWithinMe
        1
    WarWithinMe  
       Aug 1, 2012
    直接用touchstart, touchmove, touchend就能实现。。。

    BTW, jqueryMobile有多大的体积?
    tearsinchina
        2
    tearsinchina  
    OP
       Aug 1, 2012
    @WarWithinMe 你可以试试,放2个div,在每个div上bind上touchstart touchmove事件,移动到第2个div时候是不会触发touchevent的
    benzhe
        3
    benzhe  
       Aug 1, 2012
    你应该把事件绑定在 container 上,而不是单元格吧?
    WarWithinMe
        4
    WarWithinMe  
       Aug 2, 2012
    我也觉得是直接绑定到container里面,然后计算落在哪个地方。。。
    tearsinchina
        5
    tearsinchina  
    OP
       Aug 3, 2012
    it is ok, i setup touchmove on the table ,then get cell id by calculating pageX and pageY
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4774 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 09:54 · PVG 17:54 · LAX 02:54 · JFK 05:54
    ♥ Do have faith in what you're doing.