【发布时间】:2014-04-17 16:19:21
【问题描述】:
我开始使用 Emberjs :) 我正在尝试使用淡入淡出的 jquery 效果显示模型中的图片
$('.ember-view img').load( ->
$(this).fadeIn(10000).show()
).each( ->
$(this).load() if(this.complete)
)
我尝试了不同的方法来找到触发此事件的好地方,但我无法找到创建触发此事件的方法的好地方
我有这条路线
MyApp.SquaresRoute = Ember.Route.extend(
setupController: (controller) ->
controller.set('model', @store.find('sqimage'))
我还有 2 个控制器(数组和对象)
MyApp.SquaresController = Ember.ArrayController.extend
MyApp.SquareController = Ember.ObjectController.extend
以及我渲染对象的模板
{{#each controller}}
<img {{bind-attr src="url_thumbnail"}} {{bind-attr style="style"}} />
{{/each}}
我尝试在视图文件中放置一个 didInsertElement,但没有成功。
我应该使用观察者吗?我应该把它放在哪里?
感谢您的回答!
【问题讨论】: