Skip to content

Commit 2c246cf

Browse files
committed
Update bbq demo
1 parent e915e10 commit 2c246cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

demo/bbq.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ <h2>Smooth Scroll jQuery Plugin with Back Button Support</h2>
2525
<li><a href="#p3">p3</a></li>
2626
<li><a href="#p4">p4</a></li>
2727
<li><a href="#p5">p5</a></li>
28+
<li><a href="index.html#p5">index.html#p5</a> (goes to new page)</li>
2829
<li><a href="#">#</a></li>
30+
2931
<li><a href="#not-here">not-here</a></li>
3032
</ul>
3133
<p id="p1">p1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
@@ -48,7 +50,7 @@ <h2>Smooth Scroll jQuery Plugin with Back Button Support</h2>
4850
<script>
4951
$(document)
5052
.on('click', 'a[href*="#"]', function() {
51-
if ( this.hash ) {
53+
if ( this.hash && this.pathname === location.pathname ) {
5254
$.bbq.pushState( '#/' + this.hash.slice(1) );
5355
return false;
5456
}

0 commit comments

Comments
 (0)