用jcanvas一起移动两层

时间:2015-05-24 18:47:21

标签: html5-canvas jcanvas

使用jcanvas,如何链接两个可拖动的图层,使它们一起移动。
enter image description here
如。圆圈和文档图标是两个差异图层。我怎么拥有它们
a)在同一层上绘图或b)一起移动

  // document
      .drawArc({
      layer: true,
      groups: ['document'],
      fillStyle: 'yellow',
      x: 100, y: 250,
      radius: 50
      })

      .drawImage({
      groups: ['document'],
      source: "img/document.jpg",
      x: 100, y: 250,
      width:40, height: 40,
      layer: true
    })


    $('canvas').setLayerGroup('document', {
      draggable: true,
      bringToFront: true
    })

1 个答案:

答案 0 :(得分:0)

您可以使用$(document).on("click","#ulUNNotifications a",function(e){ e.preventDefault(); $(this).css('font-weight', 'normal'); var aHre=$(this).attr('href'); fnShowDetails('' + aHre + '', $(this).text()); });

执行此操作

此处代码

dragGroups:[]