简体   繁体   English

我可以将el用作其他库的div标识吗?

[英]Can I use el as div identification for other libraries?

I'm using backbone.js and iScroll. 我正在使用bone.js和iScroll。 As part of the render process I need to create a new instance of iScroll and I'm suppose to pass it a div id . 作为渲染过程的一部分,我需要创建一个新的iScroll实例,并假设将其传递给div id

new_iScroll = new iScroll 'divID'

When rendering things with backbone I love not having to uniquely id every parent div to be able to target it. 用主干渲染东西时,我喜欢不必为每个父div唯一地id一个目标。 Could I do something similar in this case? 在这种情况下,我可以做类似的事情吗? Is there any way I could pass in this.el ? 有什么办法可以让我通过this.el吗? If not what is the next best way to handle this kind of id ing in the context of backbone? 如果没有什么是处理这种类型的下一个最好的办法id ING在骨干网的情况下?

Thanks! 谢谢!

根据iscroll.js中的58行:是的,您可以传递常规DOM元素以及ID

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

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