【问题标题】:Tweenlite adds transform to style instead of custom attributeTweenlite 将变换添加到样式而不是自定义属性
【发布时间】:2016-02-26 20:57:38
【问题描述】:

我正在使用带有 tweenlite 和可拖动库的缩放、旋转和移动图像。

TweenLite.to(image, 0, {rotation: value, transformOrigin:"50% 50%"});
TweenLite.to(image, 0, {scaleX: value, scaleY: value, transformOrigin:"50% 50%"});
Draggable.create(image, {type: "x,y", throwProps: true, zIndexBoost: false,
      force3D: false});

它有效。问题是当我导出 svg 时,这个 svg 在任何地方都不起作用。 库为样式属性添加变换:

 style="overflow: visible; cursor: move; touch-action: none; -webkit-user-  
select: none; transform: matrix(0.08244, 0, 0, 0.08244, 111, 17);"

如何在保存 svg 时完全清除此样式属性并将仅添加转换为单独的属性:

transform="matrix(0.08244 0 0 0.08244 111 17)"

据我了解,库中有一些设置可以使用 attr 而不是样式,但找不到使用 attr 的方法。

【问题讨论】:

  • 如果你想清除它,你可以去transform: none
  • 正在使用最新版本的 GSAP? (当前版本为 1.18.0)。 when I export svg 是什么意思? ..你从什么出口? ..一些额外的信息将不胜感激。以及 codepen 或 jsfiddle 示例。这样我们就可以实时看到您的代码
  • 是的,它是 1.18.0 我的意思是不要将变换添加到样式中,例如: 但作为属性:

标签: css svg gsap


【解决方案1】:

【讨论】:

  • 我已经尝试过了,但它不起作用。: Draggable.create(image, {attr:{type: "x,y", throwProps: true, zIndexBoost: false,force3D: false }});我应该改变什么吗?
猜你喜欢
  • 2011-09-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多