EXDestroyer
V2EX  ›  jQuery

jQuery 的 index()方法有办法返回二维的数组索引吗?

  •  
  •   EXDestroyer · Feb 7, 2015 · 3321 views
    This topic created in 4308 days ago, the information mentioned may be changed or developed.

    jQuery的index()方法有办法返回二维的数组索引吗?
    比如x:1 y:2

    2 replies  •  2015-02-07 22:34:02 +08:00
    kisshere
    kisshere
    Feb 7, 2015
    1
    只有each遍历上一层数组,看是否在数组里面
    haozhang
    haozhang
    Feb 7, 2015 via iPhone
    2
    为什么不用对象呢,一个对象数组包含很多个点dui xiang,对象表示一个点,有xy属性。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   968 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:27 · PVG 06:27 · LAX 14:27 · JFK 17:27
    ♥ Do have faith in what you're doing.