File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ <h2>Smooth Scroll jQuery Plugin with Back Button Support</h2>
5353 < script >
5454 $ ( document ) . ready ( function ( ) {
5555
56- $ ( ' a[href*="#"]' ) . live ( 'click ', function ( ) {
56+ $ ( document ) . on ( 'click' , ' a[href*="#"]', function ( ) {
5757 var slashedHash = '#/' + this . hash . slice ( 1 ) ;
5858 if ( this . hash ) {
5959
Original file line number Diff line number Diff line change @@ -46,15 +46,14 @@ <h2>Smooth Scroll jQuery Plugin with Back Button Support</h2>
4646 < script src ="../src/jquery.smooth-scroll.js "> </ script >
4747 < script src ="../lib/jquery.ba-bbq.js "> </ script >
4848 < script >
49- $ ( document ) . ready ( function ( ) {
50-
51- $ ( 'a[href*="#"]' ) . live ( 'click' , function ( ) {
52- if ( this . hash ) {
53- $ . bbq . pushState ( '#/' + this . hash . slice ( 1 ) ) ;
54- return false ;
55- }
56- } ) ;
57-
49+ $ ( document )
50+ . on ( 'click' , 'a[href*="#"]' , function ( ) {
51+ if ( this . hash ) {
52+ $ . bbq . pushState ( '#/' + this . hash . slice ( 1 ) ) ;
53+ return false ;
54+ }
55+ } )
56+ . ready ( function ( ) {
5857 $ ( window ) . bind ( 'hashchange' , function ( event ) {
5958 var tgt = location . hash . replace ( / ^ # \/ ? / , '' ) ;
6059 if ( document . getElementById ( tgt ) ) {
You can’t perform that action at this time.
0 commit comments