Team:UCL/Template:MainJS

From 2014.igem.org

(Difference between revisions)
 
(One intermediate revision not shown)
Line 1: Line 1:
-
<script>
 
( function( $ ) {
( function( $ ) {
Line 15: Line 14:
console.log('we are on mobile');
console.log('we are on mobile');
-
// Destroy Skrollr
 
var s = skrollr.init();
var s = skrollr.init();
s.destroy();
s.destroy();
Line 30: Line 28:
} )( jQuery );
} )( jQuery );
-
 
-
 
-
</script>
 

Latest revision as of 20:47, 4 August 2014

( function( $ ) {

function enableSkrollr(){ console.log('we are on desktop');

var s = skrollr.init({ forceHeight: false });

}

function disableSkrollr(){ console.log('we are on mobile');

var s = skrollr.init(); s.destroy(); }

enquire.register("screen and (min-width: 768px)", { match : function() { enableSkrollr(); }, unmatch : function() { disableSkrollr(); } });

} )( jQuery );