Skip to content

Instantly share code, notes, and snippets.

@f
Created January 30, 2011 20:44
Show Gist options
  • Save f/803230 to your computer and use it in GitHub Desktop.
Save f/803230 to your computer and use it in GitHub Desktop.
<style>
.box {
float: left;
width: 30px;
height: 30px;
border: 1px solid red;
}
.clear {
clear: both;
}
.containerr {
width: 254px;
height: 100px;
border: 1px solid blue;
display: none;
}
</style>
<script>
function goster(element)
{
$('.containerr').hide();
$('#div_'.$(element).attr('id')).show();
}
</script>
<div>
<div onClick="goster(this)" class="box" id="1">1</div>
<div onClick="goster(this)" class="box" id="2">2</div>
<div onClick="goster(this)" class="box" id="3">3</div>
<div onClick="goster(this)" class="box" id="4">4</div>
<div onClick="goster(this)" class="box" id="5">5</div>
<div onClick="goster(this)" class="box" id="6">6</div>
<div onClick="goster(this)" class="box" id="7">7</div>
<div onClick="goster(this)" class="box" id="8">8</div>
<div class="clear"></div>
</div>
<div>
<div class="containerr" id="div_1">1 div</div>
<div class="containerr" id="div_2">2 div</div>
<div class="containerr" id="div_3">3 div</div>
<div class="containerr" id="div_4">4 div</div>
<div class="containerr" id="div_5">5 div</div>
<div class="containerr" id="div_6">6 div</div>
<div class="containerr" id="div_7">7 div</div>
<div class="containerr" id="div_8">8 div</div>
</div>
<div>
<div onClick="goster(this)" class="box" id="9">1</div>
<div onClick="goster(this)" class="box" id="10">2</div>
<div onClick="goster(this)" class="box" id="11">3</div>
<div class="clear"></div>
</div>
<div>
<div class="containerr" id="div_9">1 div</div>
<div class="containerr" id="div_10">2 div</div>
<div class="containerr" id="div_11">3 div</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment