Skip to content

Instantly share code, notes, and snippets.

@vagnerzampieri
Created October 1, 2013 23:10
Show Gist options
  • Select an option

  • Save vagnerzampieri/6786657 to your computer and use it in GitHub Desktop.

Select an option

Save vagnerzampieri/6786657 to your computer and use it in GitHub Desktop.
Abrindo os conteúdos dos links de forma dinâmica. Também pode ser acessado o teste neste link http://js.do/code/821
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<div id="insertTonalidade">
<h5>Insirar uma tonalidade:</h5>
<a href="#" id="tons-link" class="c">C</a>
<div id="tonalidades-c" style="display: none" >
<label class="checkbox">
<input type="checkbox" name="cordas" value="cordas">
C
</label>
<label class="checkbox">
<input type="checkbox" name="cordas" value="cordas">
Cm
</label>
</div>
<a href="#" id="tons-link" class="d">D</a>
<div id="tonalidades-d" style="display: none" >
<label class="checkbox">
<input type="checkbox" name="cordas" value="cordas">
D
</label>
<label class="checkbox">
<input type="checkbox" name="cordas" value="cordas">
Dm
</label>
</div>
</div>
<script>
$(document).ready(function(){
$("a#tons-link").click(function(){
$("#tonalidades-" + $(this).attr("class")).toggle();
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment