Skip to content

Commit

Permalink
Change .live to .on in BBQ demos
Browse files Browse the repository at this point in the history
  • Loading branch information
kswedberg committed Feb 3, 2013
1 parent 4075191 commit 26e2b5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion demo/bbq-fixed.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2>Smooth Scroll jQuery Plugin with Back Button Support</h2>
<script>
$(document).ready(function() {

$('a[href*="#"]').live('click', function() {
$(document).on('click', 'a[href*="#"]', function() {
var slashedHash = '#/' + this.hash.slice(1);
if ( this.hash ) {

Expand Down
17 changes: 8 additions & 9 deletions demo/bbq.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ <h2>Smooth Scroll jQuery Plugin with Back Button Support</h2>
<script src="../src/jquery.smooth-scroll.js"></script>
<script src="../lib/jquery.ba-bbq.js"></script>
<script>
$(document).ready(function() {

$('a[href*="#"]').live('click', function() {
if ( this.hash ) {
$.bbq.pushState( '#/' + this.hash.slice(1) );
return false;
}
});

$(document)
.on('click', 'a[href*="#"]', function() {
if ( this.hash ) {
$.bbq.pushState( '#/' + this.hash.slice(1) );
return false;
}
})
.ready(function() {
$(window).bind('hashchange', function(event) {
var tgt = location.hash.replace(/^#\/?/,'');
if ( document.getElementById(tgt) ) {
Expand Down

0 comments on commit 26e2b5c

Please sign in to comment.