简体   繁体   English

重新初始化ajax加载的processing.js草图

[英]reinitialize ajax-loaded processing.js sketch

I know there is an automatic initialization method used to start sketches on conventional websites. 我知道有一种自动初始化方法可用于在常规网站上启动草图。 Is there a way to reactivate on pageload? 有没有一种方法可以在页面加载时重新激活? I know where to put the code, but I don't see the function to call to start the sketch. 我知道将代码放在哪里,但看不到调用该函数来启动草图的功能。 I've already tried processing.init(); 我已经尝试过processing.init(); although it doesn't look like it is stored as a function outright... Thanks for your help! 尽管它看起来并不像直接存储为函数一样……感谢您的帮助! I asked a similar question earlier, but it was the a libraries own function that fixed it, not the jquery .on() , live() , delegate() , etc. 我之前曾问过类似的问题,但是固定它的是库本身的函数,而不是jquery .on()live()delegate()等。

We're adding that for the next version, actually, where it will be called Processing.reload() 实际上,我们将其添加到下一个版本中,该版本将称为Processing.reload()

In the mean time you can manually create new Processing instances, either by using new Processing(...) or Processing.loadSketchFromSources(...) 同时,您可以使用新的Processing(...)或Processing.loadSketchFromSources(...)手动创建新的Processing实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM