responsive

onSlideStartClosing(e)

  • Available since: 1.0
  • Changed in: 1.2
  • Type: callback function

Callback function to be executed when a slide starts closing.

Callback creation

Callback function is specified in the configuration section of the plugin.

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

Event properties

Event is basically an object passed to function as parameter. Object can have multiple attributes which store important callback-related information.

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

You can work with this object like with any javascript object:

$('selector').jAccordion({
	onSlideStartClosing : 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

  • Source files of this demo are located in: Examples\callbackonSlideStartClosingDemo1

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

Loading content...
slide1
slide2
slide3
slide4
slide5

Changelog

version 1.2

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

You can gain access to the closing slide using e.$slide while in previous versions you could use this but since this version this (in callback function) means instance of the accordion.


jAccordion by maniacpc, exclusively for CodeCanyon