Hi,
I have the following jQuery code. As you can see, I have an alert that display the current tab that I am on based on the value from this.getIndex().
My question is, how can I get access to this value, so that I can use it within other javascript functions that don't reside with the ready(function)?
I want to be able to say instead:
tabIndx = this.getIndex()
and when this value changes, I want to use it within another function down below, outside of the ready(function), say
var tabIndx;
$(document).ready(function(){
// initialize scrollable
$("div.scrollable").scrollable({
size: 1,
items: '#thumbs',
hoverClass: 'hover',
onSeek: function() {
alert("Current tab is: "+ this.getIndex());
}
});
});
function showVal() {
alert("current tab selected is: "+ tabIndx);
}
So everytime I click on different tabs, I want the showVal() function to fire with the correct value for tabIndx.
Any ideas.
Thanks. Tony.