Skip to content

Commit 26e2b5c

Browse files
committed
Change .live to .on in BBQ demos
1 parent 4075191 commit 26e2b5c

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

demo/bbq-fixed.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

demo/bbq.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff 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) ) {

0 commit comments

Comments
 (0)