<div id="tabs" class="htabs">
<a href="#tab-description"><?php echo $tab_description; ?></a>
<a href="#tab-attribute"><?php echo $tab_attribute; ?></a>
<a href="#tab-review"><?php echo $tab_review; ?></a>
<a href="#tab-related"><?php echo $tab_related; ?> (<?php echo count($products); ?>)</a>
</div>
When I click this link, for example: .../product_id=40 by default the #tab-description is opened. How can I call #tab-review via URL to be opened first, i.e. if I enter the URL to be something like this: .../product_id=40#tab-review the #tab-review to be opened?
Thanks in advance.
EDIT: Here is the tabs.js content, and the path to this file is: …/catalog/view/javascript/jquery/tabs.js
$.fn.tabs = function() {
var selector = this;
this.each(function() {
var obj = $(this);
$(obj.attr('href')).hide();
$(obj).click(function() {
$(selector).removeClass('selected');
$(selector).each(function(i, element) {
$($(element).attr('href')).hide();
});
$(this).addClass('selected');
$($(this).attr('href')).fadeIn();
return false;
});
});
$(this).show();
$(this).first().click();
};
Are you using jQuery? You could put this in a
readylistener:If you’re not using jQuery, I’ll need some more information…