I've got this following code:
<script type="text/javascript">
$(document).ready(function(){
$('.sample1').click(function(){
$('.dropdown-content').toggleClass('visible-dropdown');
})
})
</script>
It adds class so I can get some animations with mouse click event. I have some more classes in HTML like 'sample2', 'sample3', etc. and would like to add exactly the same animations (classes of course has different content).
I know one solution, namely just add in same code n-times, but change class for each block of code. Is there a shorter way? I thought maybe something with arrays, not sure. I'm not really good in JS, it's like my first time ;)