From deebd78d5bcf730a19b48203e80b6eeeeac02986 Mon Sep 17 00:00:00 2001 From: Utkarsh Kukreti Date: Fri, 4 Jan 2013 16:44:55 +0530 Subject: [PATCH] Disable links with href=#, so users can preview :active state easily. --- docs/assets/js/index/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/assets/js/index/index.js b/docs/assets/js/index/index.js index 18dc296b4..7e9f0276d 100644 --- a/docs/assets/js/index/index.js +++ b/docs/assets/js/index/index.js @@ -25,9 +25,12 @@ $(function() { } }); - - - + // Disable links with href="#" inside
, so users can click on them + // to preview :active state without being scrolled up to the top of the page. + $('section a[href="#"]').click(function(e) { + e.preventDefault(); + e.stopPropagation(); + }); var firstInHistory = true;