Use URL to show corresponding div id
I was wondering if some one could help me out. I am not very knowledgeable when it comes to jQuery but I would like to be. I would like to have some jQuery that will look at the url and based on what directory it is pointing to, it will "activate/show" a corresponding div. Here is the code I have to show the first div in a list of div's when the page loads. But I would rather this load the div that the url says:
- $(".tab_content").hide(); //Hide all content
- $("#navbar ul li:first").addClass("active").show(); //Activate first tab
- $(".tab_content:first").show(); //Show first tab content
So if the url is www.myurl.com/divtag/index.htm. I would like the div id tag called divtag to show when the page is loaded.
Hopefully you understand what I am saying. Let me know if you would like more info/code.
Thanks in advanced!
Austin