I'm not aware of a modified version of FCG that comes with an onChange event handler, but regardless, the below modified one (see .js file) adds it. Using it, you can tact on an onChange event to your initialization code like so:
Code:
featuredcontentglider.init({
gliderid: "canadaprovinces", //ID of main glider container
contentclass: "glidecontent", //Shared CSS class name of each glider content
togglerid: "p-select", //ID of toggler container
remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
selected: 0, //Default selected content index (0=1st)
persiststate: false, //Remember last content shown within browser session (true/false)?
speed: 500, //Glide animation duration (in milliseconds)
direction: "downup", //set direction of glide: "updown", "downup", "leftright", or "rightleft"
autorotate: true, //Auto rotate contents (true/false)?
autorotateconfig: [3000, 2], //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
onChange: function($prevcontent, $curcontent, $allcontents){
if ($prevcontent.length > 0){ // if previous content exists (this isn't the very first slide shown)
console.log( $prevcontent.text().substring(0,10), $curcontent.text().substring(0,10) )
}
}
})
Notice the trailing comma (,) after every option except the very last, in this case, onChange. This function is passed two parameters, a jQuery reference to the lastshown slide (a DIV), and the currently shown slide (a DIV as well). In the above example, I log to Firefox's console the first 10 characters of the last shown slide's contents, plus the current's.
Now to your youTube question specifically, how are you embedding the youtube videos, via IFRAME?
Bookmarks