Activating J Query tab from Seperate Image Link
Hi, I'm new to Jquery programming and I was hoping somebody could help.
What I'm looking to do is to have a user click on an image towards the top of my website and then have the browser scroll down and activate the tab.
This is my script in the <head> tags of my document:
- <script type="text/javascript">
$(function() {
$('#container-1 ul').tabs();
});
</script>
Further down I have a tabs system set up like this:
- <a name="description">
- <div id="container-1">
- <ul>
<li><a href="##fragment-1"><span>Features</span></a></li>
<li><a href="##fragment-2"><span>Pricing</span></a></li>
</ul>
- <div id="fragment-1">#q_getproduct.description#</div>
<div id="fragment-2">Stuff Here</div>
- </div>
Now my image button is fairly simple:
- <a href="#description" id="my-text-link"><img src="../../_images/button_pricing.jpg" width="134" height="39" border="0"></a>
I noticed you can do it the following way, however I have no idea how to implement it:
var $tabs = $('#example').tabs(); // first tab selected
$('#my-text-link').click(function() { // bind click event to link
$tabs.tabs('select', 2); // switch to third tab
return false;});
If anyone could please help I would greatly appreciate it.