Skip to content

Commit 555cf88

Browse files
committed
Fixed Navigation Links
Updated Epsilon
1 parent 8115918 commit 555cf88

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

assets/js/shapely-scripts.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
element = $( '#site-navigation #menu a[href=' + window.location.hash + ']' );
2626
if ( element ) {
2727
scrollToID = '#' + element.data( 'scroll' );
28+
29+
if ( jQuery( scrollToID ).length < 1 ) {
30+
scrollToID = window.location.hash;
31+
}
32+
33+
if ( jQuery( scrollToID ).length < 1 ) {
34+
return;
35+
}
36+
2837
$( 'html,body' ).animate( {
2938
scrollTop: $( scrollToID ).offset().top
3039
}, 2000 );
@@ -37,6 +46,15 @@
3746

3847
$( '#site-navigation #menu a[href^=#]:not([href=#])' ).click( function( evt ) {
3948
var scrollToID = '#' + $( this ).data( 'scroll' );
49+
50+
if ( jQuery( scrollToID ).length < 1 ) {
51+
scrollToID = $( this ).attr( 'href' );
52+
}
53+
54+
if ( jQuery( scrollToID ).length < 1 ) {
55+
return;
56+
}
57+
4058
evt.preventDefault();
4159
$( 'html,body' ).animate( {
4260
scrollTop: $( scrollToID ).offset().top

inc/libraries/epsilon-framework

0 commit comments

Comments
 (0)