Can someone help me with my jquery script. I'm having some issues and can't see where I went wrong. I have a single page site and I am trying to get the slide toggle effect to start off closed when the page opens and open/close only on click. Right now, when the page opens each section of the slide toggle is already open :/
here is my script so far:
here is my script so far:
Code:
<script type="text/javascript">
jQuery(function($) {
var openText = 'Open';
var closeText = 'Close';
$('.item-util .more-toggle').toggle(
function() {
$(this).html(closeText);
$(this).parent().siblings('div').slideToggle('slow');
},
function() {
$(this).html(openText);
var returnTo = $(this).parents('.item');
$.scrollTo(returnTo, {offset:{top:-150, left:0}, duration:600});
$(this).parent().siblings('div').slideToggle('slow');
}
);
});
</script>
Last edited by a moderator: