I am currently working on a website using jQuery, and I have implemented a slide in and out div to display share buttons. The issue I am facing is that the code works perfectly on the first page, but on every other page, the div slides out momentarily and then slides back in continuously. It's quite puzzling.
Interestingly, when I tested the same code on a fiddle, it worked flawlessly! Here is the link to the fiddle: http://jsfiddle.net/4hUzH/
<script>
$(function() {
$('.toggleNotes').click(function() {
$nextArticle = $(this).next('.article');
$nextArticle.is(':visible') ? $nextArticle.slideUp() : $nextArticle.slideDown();
return false;
});
});
</script>
<style>
.article {
display: none;
}
</style>
<a href="#" class="toggleNotes">Click here</a>
<div class="article">
This is where the buttons show up.
</div>
If anyone can shed some light on why the div keeps sliding out and back in repeatedly, I would greatly appreciate it.