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>
53
53
< script >
54
54
$ ( document ) . ready ( function ( ) {
55
55
56
- $ ( ' a[href*="#"]' ) . live ( 'click ', function ( ) {
56
+ $ ( document ) . on ( 'click' , ' a[href*="#"]', function ( ) {
57
57
var slashedHash = '#/' + this . hash . slice ( 1 ) ;
58
58
if ( this . hash ) {
59
59
Original file line number Diff line number Diff line change @@ -46,15 +46,14 @@ <h2>Smooth Scroll jQuery Plugin with Back Button Support</h2>
46
46
< script src ="../src/jquery.smooth-scroll.js "> </ script >
47
47
< script src ="../lib/jquery.ba-bbq.js "> </ script >
48
48
< 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 ( ) {
58
57
$ ( window ) . bind ( 'hashchange' , function ( event ) {
59
58
var tgt = location . hash . replace ( / ^ # \/ ? / , '' ) ;
60
59
if ( document . getElementById ( tgt ) ) {
You can’t perform that action at this time.
0 commit comments