Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function goToByScroll(id){
- // Reove "link" from the ID
- id = id.replace("link", "");
- // Scroll
- $('html,body').animate({
- scrollTop: $("#"+id).offset().top},
- 'slow');
- }
- $("#sidebar > ul > li > a").click(function(e) {
- // Prevent a page reload when a link is pressed
- e.preventDefault();
- // Call the scroll function
- goToByScroll($(this).attr("id"));
- });
- var $j = jQuery.noConflict();
- $j(document).ready(function(){
- $j("#test").css("padding","10px");
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement