绑定onLoad和onLeave事件不成功

来源:3-2 静态页思路验证-组件切换

番茄乌梅

2016-08-05

$(function(){
			$('#h5').fullpage({
				'sectionsColor':['#254875','#00ff00','#254587','#695684'],
				onLeave:function (index,nextIndex,direction) {
					console.log(index)
				},
				afterLoad:function (index,nextIndex,direction) {
						
				}
			});
			$('.page').on('onLeave',function(){
				console.log($(this).attr('id'),'===>','onleave')
			});
			$('.page').on('afterLoad',function(){
				console.log($(this).attr('id'),'===>','afterLoad')
			})
		})

http://szimg.mukewang.com/57a438e80001036010840444.jpg

写回答

1回答

Lyn

2016-08-08

$('.page').trigger('onLoad') // <--注意事件名的大小写
0
0

Web App用组件方式开发全站

用HTML5/CSS3/JS流行技术,实现移动端可视化数据报告

3164 学习 · 517 问题

查看课程