我使用 twitter-bootstrap 创建顶部栏菜单,它工作正常
.topbar
.topbar-inner
.container-fluid
{{#view Mediawrap.menuView id="menuView"}}
= link_to 'Mediawrap', root_path, {:class=>"brand"}
%ul.nav
%li.menu
= link_to 'Search', "#", {:class=>"menu"}
%ul.menu-dropdown
%li
= link_to "Hide date search", "#"
%li
= link_to "Hide index search", "#"
%li
= link_to "Hide advance search", "#"
%li
= link_to "Clear search", "#"
%li.divider
%li
= link_to 'Save to new folder ...', "#"
%li
= link_to 'Replace a folder', "#"
{{/view}}
直到我尝试将 Sproutcore 添加到页面。我的下拉菜单停止工作。我认为这是因为在 Sproutcore 生成 HTML 标记之前调用了“$(document).ready(function()”。
$(document).ready(function() {
alert("bank");
$(".topbar").dropdown();
});
sproutcore 完成生成 HTML 标记后,如何在 document.ready 中调用命令