0

I have no idea why this isnt working for me. Maybe one of the jQuery Guru's out there can help me make this work!

From the script below you can see that i have a UL block named five that i would like to ease to there anchor(#web). When i click the menu item i do get the alert to activate so i think that part is correct.

$(function() {
$('ul.five a').bind('click',function(event){
    var $anchor = $(this);
    alert('hellooo')
    $('html, body, section').stop().animate({
        scrollTop: $($anchor.attr('href')).offset().top
    }, 500,'easeInOutExpo');

    event.preventDefault();
});

});

This is what one of my sections looks like in case this would help?

<section class="row divider-down" id="section1">
<header>
    <h1><img src="image/image1.png" alt="Alt"></h1>
    <p>some text</p>
</header>

Does anyone see anything that is obviously wrong here? Like i said the alert pops up but it doesnt "ease" down to the section?

TravisT6983
  • 53
  • 1
  • 4
  • 8
  • 1
    And just to clarify: you are trying to scroll the page down to some `section` that is associated with the `anchor` that was clicked? Can you please provide some html for the anchors? – lbstr Jun 22 '12 at 18:24
  • To be honest i copied the line scrollTop: $($anchor.attr('href')).offset().top from the example i was following... yes i am trying to scroll down the page from menu of images to a section on the site... this is the HTML for the
  • – TravisT6983 Jun 22 '12 at 18:45