Info callback.

Variable Value
items
allItems
currentPosition
currentPage
allPages
autoplay
windowWidth
elWidth
breakpoint

Descripton

'info' option is the only function callback in Owl Carousel 2 and doesnt need to be activated by option callback:true. Can be used to obtain basic information about items/pages/widths etc.

Info function has two parameters. First is object that containes information, second is Owl non jquery object reference.
Note that Item and page positions are zero based values. If you need more specific variables there just let me know.


//Javascript

$('.owl-carousel').owlCarousel({
	items:1,
	loop:true,
	nav:true,
	margin:10,
	info: getInfo,
	responsive:{
		600:{
			items:3
		},			
		960:{
			items:5,
			center:true
		},
		1200:{
			items:6,
			center:false
		}
	}
});

// Insert info into table
function getInfo(i){
	var owlInfo = i,prop,value,name;

	for(prop in owlInfo){
		if(owlInfo.hasOwnProperty(prop)){
			value = owlInfo[prop];
			name = prop;
			$('.'+name).text(value);
		}
	}
}

	
下载代码说明
X关闭

适应pc客户端、ipad、手机等多种终端浏览器的图

多种版本的,适合目前主流中端的jquery图片滚动插件,适合中端包括 pc客户端、pad客户端以及手机客户端三种。