JQuery Tabs URL Link to select tab

I am using the below JQuery code for my tabs.

$(function () {
	var tabContainers = $('#Content > div');
	$('#Services_Tabs a').click(function () {
		$('#Services_Tabs li').removeClass('Current_Services_Tab');
		return false;

Open in new window

HMTL below:

<div id="Services_Tabs">

<li><a href="#first">Extentions &amp; Conversion</a></li>
<li><a href="#second">Refurbishment &amp; Maintenance</a></li>
<li><a href="#third">Kitchens &amp; <br /> Bathrooms</a></li>
<li><a href="#forth">Plumbing &amp; <br /> Damp proofing</a></li>
<li><a href="#fifth">General building, Electrical &amp; Decorating</a></li>


<div id="Content">

<div id="first">


<div id="second">


<div id="third">


<div id="forth">


<div id="fifth">




Open in new window

How can I link to a particular tab from another page. i.e. Instead of when the page opens it shows particular tab instead of just the first one.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pravin AsarPrincipal Systems EngineerCommented:
Look the code.

<script type="text/javascript">
                  $('#my-text-link1').click(function() { // bind click event to link
                        var $tabs = $('#tabs').tabs();
                            $tabs.tabs('select', 0); // switch to first tab
                            return false;
                  $('#my-text-link2').click(function() { // bind click event to link
                        var $tabs = $('#tabs').tabs();
                            $tabs.tabs('select', 1); // switch to first tab
                            return false;
                  });                  return;

<div id="tabs">
      <ul style="color:#ff0000;">
            <li><a href="#tabs-1">Stage Events</a></li>
            <li><a href="#tabs-2">Registration Form</a></li>
            <li><a href="#tabs-3">Contact</a></li>
      <div id="tabs-1">
            <p>TAB 1</p>
      <div id="tabs-2">
            <p>TAB 2</p>
      <div id="tabs-3">
       <p>TAB 3</p>
       <div style="text-align:center;">
       <a id="my-text-link1" href="#">GOTO TAB 1</a>
       <div style="text-align:center;">
       <a id="my-text-link2" href="#">GOTO TAB 2</a>
petewinterAuthor Commented:
Thanks, but is that based of the URL parameter?
Retrieve a gup function, for example : http://www.netlobo.com/url_query_string_javascript.html

var $tabs = $('#tabs').tabs();
var tab = gup('tab_number_to_open'); // i.e : http://www.domain.com?page.html?tab_number_to_open=2
$tabs.tabs('select', tab);

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
petewinterAuthor Commented:
Many thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.