에 의해 쇼 사업부는이 코드를 가지고 :jQuery를 : 동적 ID
<ul>
<li><a href="#" class="service-chooser" id="ubuntu-one">Ubuntu One</a></li>
<li><a href="#" class="service-chooser" id="ftp">FTP account</a></li>
</ul>
<!-- these div are hidden -->
<div id="ubuntu-one-form" class="hide">
Ubuntu One credential
</div>
<div id="ftp-form" class="hide">
Ftp Crediental
</div>
내가 링크의 ID를 기반으로 사업부를 보여주고 싶은 링크를 클릭 할 때 :
<script type="text/javascript">
$(document).ready(function() {
$(".service-chooser").click(function() {
var service = $(this).attr('id');
var service-id = '#' + service + 'form';
$(service-id).show('slow', function() {
// Animation complete.
});
});
});
</script>
그러나 작동하지 않습니다.