Skip to content

Instantly share code, notes, and snippets.

@yevhenii-horbenko
Last active August 25, 2016 00:56
Show Gist options
  • Save yevhenii-horbenko/264d6c1e1d833255fd105ed6567230e2 to your computer and use it in GitHub Desktop.
Save yevhenii-horbenko/264d6c1e1d833255fd105ed6567230e2 to your computer and use it in GitHub Desktop.
Переключатели картинок
$(".controls").on("click", ".control", function(){
$(".controls .control").removeClass("active"); //удаляем класс во всех вкладках
$(this).addClass("active"); //добавляем класс текущей (нажатой)
});
$(".control1").click(function(){
$('.header-bg').css({'background-image' : 'url(img/box1-slide1.jpg)'});
});
$(".control2").click(function(){
$('.header-bg').css({'background-image' : 'url(img/box1-slide2.jpg)'});
});
$(".control3").click(function(){
$('.header-bg').css({'background-image' : 'url(img/box1-slide3.jpg)'});
});
$(".control4").click(function(){
$('.header-bg').css({'background-image' : 'url(img/box1-slide4.jpg)'});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment