Info
Info content ...
Thank you, in advance, for those who answer =)
I\'m trying to switch between divs when i click the links with the respective class (as follow on the code bellow).
It works f
I think that the best way to fix it is this:
HTML:
Info
Info content ...
Gallery
Gallerycontent ...
jQUERY:
$(document).ready(function(){
$(".content").hide();
$(".cont").click(function() {
if ($(this).hasClass("info")){ $("#info").slideToggle(500); }
if ($(this).hasClass("gallery")){ $("#gallery").slideToggle(500); }
if ($(this).hasClass("projectos")){ $("#projectos").slideToggle(500); }
if ($(this).hasClass("contactos")){ $("#contactos").slideToggle(500); }
// $(".content").slideToggle(500);
});
});
All I've done was to change cont id to cont class. Remember that two or more elements can't have the same ID, so only the first element will be considered.
Ah! And as lmsteffan told, in JQUERY you're using "galerias" and in HTML "gallery". Please check it.