Hi all, quick question about a website I am about to build. Basically, somewhere on the homepage, presumably quite far down closer to the footer I will have a div with two clickable tabs: when clicked they will show different content but the url of the page needs to stay the same (as opposed to the main proper navigation I supposed). This can be achieved only with javascript right?

Right.

thanks pritaeas, just wanted to be extra sure!

Just as an extra note... If the only options are javascript and CSS, I also agree that javascript is the only option regarding a click event. However, this can also be achieved server side. For example, this is quite easy to implement without javascript in asp.net using panels. The downside of not using javascript is the postback.

css, perhaps the same structure as a css menu, no requirement for javascript
use button div instead of .menu ul , set the styles to dispplay or not display

thanks JorgeM, but I will probably stick to javascript, I don't develop in asp.net so I dont' feel confident with it.
@almostbob, that way I won't be able to add any effect though

The effects available in css menus, include slide flyout fade z-index layers, and work when javascript is disabled, and on devices without javascript ability,
(recent convert)
no longer require javascript on 7 sites, last one is being converted

edit: as bad as a born-again non-smoker, I do it so everyone else must

but I will probably stick to javascript, I don't develop in asp.net so I dont' feel confident with it.

Ahh.. so either you looked up panels are you are at least familiar with the concept in asp.net... In any case, there are other methods using other scripting languages. I only mentioned the server-side stuff because you mentioned the word "only" in your post. client-side is not the only way to do it, but doing this client side with javascript/jQuery significantly enhances the experience for your user.

This can be achieved only with javascript right?

Do you need more help with this or did it solve your question/issue?

Thanks JorgeM, yes, since I mentioned "only" it was good to know all the options : -)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.