-1

I want user select a radio input

 <input id="package1" type="radio" name="package1" value="package1" onClick="document.getElementById('complate').scrollIntoView();" />
 <input id="package2" type="radio" name="package2" value="package2" onClick="document.getElementById('complate').scrollIntoView();" />

This event fast scroll to section but I need smooth scroll

Jonas
  • 121,568
  • 97
  • 310
  • 388
lock
  • 711
  • 3
  • 9
  • 19
  • possible duplicate of [scrollintoview animation](http://stackoverflow.com/questions/12102118/scrollintoview-animation) – urbz Jun 24 '15 at 09:32

1 Answers1

1

Try this jQuery snippet:

$('.packageBtn').click(function() {
    $('html, body').animate({
        scrollTop: $('#complate').offset().top
    }, 1000);
});

And add the class of packageBtn to your radio buttons. E.G:

<input id="package1" class="packageBtn" type="radio" name="package1" value="package1"/>
Drummad
  • 722
  • 1
  • 6
  • 23