how to make simple this show/hide script? :)
-
$(document).ready(function() {
[b]// hides all gallery div's[/b]
$('#galerija_a').hide();
$('#galerija_b').hide();
$('#galerija_c').hide();
$('#galerija_d').hide();
[b]// show gallery when clicked link // hide others if they are visible[/b]
$('a#galerija_a_on').click(function() {
$('#galerija_a').show();
$('#galerija_b').hide();
$('#galerija_c').hide();
$('#galerija_d').hide();
[b]// click on link again, becouse it calls another function (etc. scroll to that div)[/b]
$("a#galerija_a_on").click();
return false;
});
// show gallery when clicked link // hide others
$('a#galerija_b_on').click(function() {
$('#galerija_a').hide();
$('#galerija_b').show();
$('#galerija_c').hide();
$('#galerija_d').hide();
// click on link again, becouse it calls another function (etc. scroll to that div)
$("a#galerija_b_on").click();
return false;
});
// show gallery when clicked link // hide others
$('a#galerija_c_on').click(function() {
$('#galerija_a').hide();
$('#galerija_b').hide();
$('#galerija_c').show();
$('#galerija_d').hide();
// click on link again, becouse it calls another funktion (etc. croll to that div)
$("a#galerija_c_on").click();
return false;
});
// show gallery when clicked link // hide others
$('a#galerija_d_on').click(function() {
$('#galerija_a').hide();
$('#galerija_b').hide();
$('#galerija_c').hide();
$('#galerija_d').show();
// click on link again, becouse it calls another funktion (etc. croll to that div)
$("a#galerija_d_on").click();
return false;
});
});
i have 5 div's where is some pictures.. and all are hidden, when i press on the link div shows up.., and then simulates Click() on link
howto make it simple?