Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

A little help with my site

Hi

I'm currently in the process of creating this site for an internship. I'm having one small issue with my FAQ linking to differing areas of the site.

I'm having this issue due to the tabbed content on pages being hidden till some one clicks on the side nav. I don't know how to call up say tab 2 on a page through a link on the FAQ page. Using an ID will just bring you that part on the page obviously, but still show the top active tab.

Hopefully i'm being clear. Any feedback on the site would be great also, cheers.

Page in question. Nothign is really linked up int he FAQ, as I have been trying to figure out hwo to sort this. http://johncashin.net/test_sites/getready2015/pages/helpinfo.html

Jeff Lemay
Jeff Lemay
14,268 Points

You'll need more than just HTML to do this. You could use javascript to get the value of the hash in your url (similar to how you are using #IDvalue to link to a specific element on the page) and then create a function that will open the desired tab.

$(document).ready(function(){
    if (window.location.hash){
        var hash = window.location.hash.substring(1);
        // close unneeded tabs and open desired tab
    }
});

Hi, cheers for the reply

Ye I was talking to a few friends and they were mentioned going about it with javascript(bit new to it). Thanks for the bit of code. It will take a little bit to understand but i'm sure ill get it to work and i'll post results!

2 Answers

anthony crowell
PLUS
anthony crowell
Courses Plus Student 10,953 Points

Hi, can you create a sitemap and access the links in it for the faqs navigation? While also using it for search engines?

Sorry I don't quiet understand your question. I'm using javascript(tabby.js) to hide the invisible content and then using my side nav to bring it up once clicked.

Linking any normal way obviously doesn't have the effect I want. I haven't been able to really tackle the issue as I have my finals this week. But Jeffs recommendation has led me to find some useful stuff on w3schools. I hope to give it ago soon enough.

Cheers, also compliments!