responsive

onSlideOpened

  • Available since: v1.0
  • Changed in: v1.2
  • Type: event

Triggers when a slide is completely open.

Callback creation

Callback can be attached to the event in the configuration section of the plugin:

$('selector').jAccordion({
	onSlideOpened : function(e) { 
		//Here goes your code, e.g. alert('Slide ' + e.index + ' is fully open.');
		//You can call any API method using this.method()
	}
});

or it can be attached after initialization using API methods bind() or on():

$('selector').data('jAccordion').bind('onSlideOpened', function(e) { 
	//Here goes your code, e.g. alert('Slide ' + e.index + ' is fully open.');
	//You can call any API method using this.method()
});

Event properties

Event object is a parameter of the callback and contains one or more attributes which store event-related info.

  • $slide - jQuery object of the open slide
  • index - index of the open slide

You can work with the event object like with any javascript object:

$('selector').jAccordion({
	onSlideOpened : function(e) { 
		//You can gain access to event property $slide using e.$slide
		//You can gain access to event property index using e.index
	}
});

Demo 1

Demo 1 demonstrates how to create your own function displaying index of a completely open slide below accordion. Opacity of completely open slide is also changed.

Loading content...
slide1
slide2
slide3
slide4
slide5

Changelog

version 1.2

Added event object (with event-related attributes) which is passed to the callback as a parameter (Described in the "Event properties" section).

You can get jQuery object of the open slide using e.$slide while in previous versions you could use this but since this version this (in callback) means instance of the accordion.


jAccordion by maniacpc, exclusively for CodeCanyon