| /******************************************************************************* |
| * Copyright (c) 2015 Eclipse Foundation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Eric Poirier (Eclipse Foundation) - Initial implementation |
| *******************************************************************************/ |
| |
| $(function() { |
| $('a[href*=#]:not([href=#])').click(function() { |
| if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { |
| var target = $(this.hash); |
| target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); |
| if (target.length) { |
| $('html,body').animate({ |
| scrollTop: target.offset().top |
| }, 1000); |
| return false; |
| } |
| } |
| }); |
| }); |