I've implemented with success a Vertical jScrollPane with tabs I'm trying to make a tab show up by default.
Can I do this by simulating a click on the link with the id #default ? If so, how?
The code is identical to the on that site. Here's the javascript:
$(function()
{
// Create the "tabs"
$('.tabs').each(
function()
{
var currentTab, ul = $(this);
$(this).find('a').each(
function(i)
{
var a = $(this).bind(
'click',
function()
{
if (currentTab) {
ul.find('a.active').removeClass('active');
$(currentTab).hide();
}
currentTab = $(this).addClass('active')
.attr('href');
$(currentTab).show().jScrollPane();
return false;
}
);
$(a.attr('href')).hide();
}
);
}
);
});
Here's the html code:
<ul class="tabs">
<li><a href="#pane1" id="default">Pane 1</a></li>
<li><a href="#pane2">Pane 2</a></li>
<li><a href="#pane3">Pane 3</a></li>
</ul>
Thank you!
Does this not work as expected, after it's initialized?
$('#default').click()