I am trying to use the JQueryUI accordion script with my backbone view. In my template, i have an h3 and div tag, one for the accordion title, and one for content. Since the extended view puts a div around the each templated item, the classes that the accordion script adds are not on the correct tags.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I believe you can just put your own placeholder on your page like this:
<div id="placeholder"/>
In your backbone view code, do NOT define el. Then define the view's el when you create the backbone view:
var search_view = new SearchView({ el: $("#placeholder") });