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

Line 23: Line 23:
 
$('#sidebar ul ul.sub').click(function(){
 
$('#sidebar ul ul.sub').click(function(){
 
$(this).children().toggleClass('active');
 
$(this).children().toggleClass('active');
 +
});
 +
$(function(){
 +
  $( "#container" ).on( "swiperight", swipeHandler );
 +
  $( "#overlay" ).on( "swipeleft", swipeHandler );
 +
  function swipeHandler( event ){
 +
$('#sidebar').toggleClass('visible');
 +
$('#overlay').toggleClass('active');
 +
$('#container').toggleClass('inactive');
 +
$('#sidebar-btn').toggleClass('inactive');
 +
  }
 
});
 
});
 
});
 
});
 
 
$(function(){
+
 
  $( "#container" ).on( "swiperight", swipeHandler );
+
  $( "#overlay" ).on( "swipeleft", swipeHandler );
+
  function swipeHandler( event ){
+
$('#sidebar').toggleClass('visible');
+
$('#overlay').toggleClass('active');
+
$('#container').toggleClass('inactive');
+
$('#sidebar-btn').toggleClass('inactive');
+
  }
+
});
+
 
 
 
 

Revision as of 15:54, 5 May 2017