Skip to content

Instantly share code, notes, and snippets.

@sakerdon
Last active February 9, 2018 22:01
Show Gist options
  • Save sakerdon/2294b06864ae80af0bc79625b0ccd043 to your computer and use it in GitHub Desktop.
Save sakerdon/2294b06864ae80af0bc79625b0ccd043 to your computer and use it in GitHub Desktop.
добавить и убрать класс
$(document).ready(function() {
function toggle() {
var btn = $('#toggler');
btn.click(function () {
$('.section').toggleClass('toggled');
})
}
toggle();
var windowWidth = $(window).width();
if(windowWidth < 830){
$('.section').addClass('toggled');
}
$('iframe[src *= "youtube"]').parent().addClass('responsive')
/* $(".sidebar").swipe( {
swipeLeft:leftSwipe,
swipeRight:rightSwipe,
threshold:0
});
function leftSwipe(event){
$('.section').addClass('toggled');
}
function rightSwipe(event){
$('.section').removeClass('toggled');
}*/
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment