Hi Guys!
I'm building a site on html,javascript/jquery and css.
i have links on the left side of the page (home, contact etc) which clicked displays appropriate and content on the right side. its (20:80) ratio.
i have a javascript file that controls the display of the content:
$(document).ready(function() {
$("#home").click(function() {
$("#homepage").toggle(1000);
});
$("#about").click(function() {
$("#about").toggle(1000);
});
$("#contacts").click(function() {
$("#contacts").toggle(1000);
});
});
Content is displayed and hidden with a click of a link. As it is right now, you can have more than one piece of content showing i.e. if i click on About then Contacts, i'll have both showing.
I had thought of using wild cards on selectors such any open content is hidden before displaying the clicked menu e.g.
$("#contacts").click(function() {
$("#*").hide() //wildcard
$("#contacts").toggle(1000);
});
I'm not sure of the correct implementation of wild cards though. Anyone help me out please. Im new to javascript and jquery.