Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Commit

Permalink
Added jRespond example JS.
Browse files Browse the repository at this point in the history
  • Loading branch information
acolangelo committed Nov 5, 2012
1 parent 9b67c4d commit 576e2ad
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/js/example-jRespond.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var jPanelMenu = {};
$(function() {
$('pre').each(function(i, e) {hljs.highlightBlock(e)});

jPanelMenu = $.jPanelMenu({
menu: 'header.main nav'
});

var jR = jRespond([
{
label: 'small',
enter: 0,
exit: 800
},{
label: 'large',
enter: 800,
exit: 10000
}
]);

jR.addFunc({
breakpoint: 'small',
enter: function() {
jPanelMenu.on();
$(document).on('click',jPanelMenu.menu + ' li a',function(e){
if ( jPanelMenu.isOpen() && $(e.target).attr('href').substring(0,1) == '#' ) { jPanelMenu.close(); }
});
},
exit: function() {
jPanelMenu.off();
$(document).off('click',jPanelMenu.menu + ' li a');
}
});
});
Loading

0 comments on commit 576e2ad

Please sign in to comment.