我有一个照片滑动 http://www.photoswipe.com/我的页面上的画廊是这样以编程方式创建的:
var instance = window.Code.PhotoSwipe.attach(image, options)
现在我想更新图库中的图像,或者在同一位置放置一个新图库。
为其创建一个新画廊DOM Element
省略以下错误:
Code.PhotoSwipe.activateInstance:
Unable to active instance as another instance is already active for this target
使用以下方法将实例与元素分离Code.PhotoSwipe.detatch(instance)
也没有帮助。
有什么想法如何用新图像填充图库或将其删除,以便我可以在同一位置创建新图像吗?
我发现避免该错误的唯一方法是调用unsetActivateInstance
before detatch
:
window.Code.PhotoSwipe.unsetActivateInstance(instance);
window.Code.PhotoSwipe.detatch(instance);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)