Difference between revisions of "Template:Cologne-Duesseldorf/js-jquery"

Line 22: Line 22:
 
});
 
});
 
});
 
});
</script>
+
</script>
+
<!-- hammer js --->
+
<script>
+
var myContainer = document.getElementById('container');
+
var myOverlay = document.getElementById('overlay');
+
 
+
// create a simple instance
+
// by default, it only adds horizontal recognizers
+
var mC = new Hammer(myContainer);
+
var mO = new Hammer(myOverlay);
+
 
+
// listen to events...
+
mC.on("panright", function(ev) {
+
$('#sidebar').addClass('visible');
+
$('#overlay').addClass('active');
+
$('#container').addClass('inactive');
+
$('#sidebar-btn').addClass('inactive');
+
});
+
 
+
mO.on("panleft", function(ev) {
+
$('#sidebar').removeClass('visible');
+
$('#overlay').removeClass('active');
+
$('#container').removeClass('inactive');
+
$('#sidebar-btn').removeClass('inactive');
+
});
+
</script>
+
 
</body>
 
</body>
 
</html>
 
</html>

Revision as of 15:00, 6 May 2017