I am writing an Ember.js application, and I would like to run the following Javascript code on a div
with a class of navbar
right after the view renders:
$('.navbar').affix({offset: -1000});
I am not aware of any way to do this easily in Ember, as the standard JQuery $(document).ready()
doesn't work with Ember apps. There has to be some easy way of doing this, but all of the other answers to this question seem to be like complex workarounds and are based on outdated versions of Ember.js.
Template in Question:
<script type="text/x-handlebars">
<div class="navbar" data-spy="affix">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
</div>
</div>
</div>
{{outlet}}
</script>