$('#h5).find('.page').eq(index).trigger('onLoad')能否换成$(this).trigger('onLoad')?
来源:

杨洋1989
2016-06-09
测试后效果相同。既然fullpage的初始化函数已经限定了id是h5页面,为何还要在内部做精确化选择?
写回答
1回答
-
可以的,这个只是因为课程的演示代码,所以这么写,这个代码没有实际意义。
实际上后面 fullPage 初始化,触发 onLoad 的代码会变成:
this.el.fullpage({ onLeave:function( index, nextIndex, direction) { $(this).find('.h5_component').trigger('onLeave'); }, afterLoad:function( anchorLink, index ) { $(this).find('.h5_component').trigger('onLoad'); } });
012016-06-13
相似问题