There are 2 buttons, "Krasnoyarsk" and "Krasnoyarsk Territory". It is necessary that by clicking on the button the map changes on the site. How to implement it? enter image description here

  • What card do you mean? - AGrief
  • Added a picture, how to do it. - Alexander

3 answers 3

$(function(){ $(".knopka-1").click(function(){ $(".block-2").fadeOut(1); $(".block-1").fadeIn(100); }); $(".knopka-2").click(function(){ $(".block-1").fadeOut(1); $(".block-2").fadeIn(100); }); }); 
 .block-1 { padding: 40px; border: 1px solid green; } .block-2 { padding: 40px; border: 1px solid red; display: none; } .knopka { margin-top: 30px; } 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="big-block"> <div class="block-1">Блок 1</div> <div class="block-2">Блок 2</div> <button class="knopka-1">кнопка 1</button> <button class="knopka-2">кнопка 2</button> </div> 

    Javascript script hangs listeners to click on both buttons. In both listeners you change the src attribute of the picture to the one you want.

    • I need the labels with icons to be in other places too, as the map will be different. In essence, you need to change the entire unit. - Alexander
    • Look, at the very beginning you were told that ifns were not enough to answer the question, you had to attach a screen. Now it turns out that icons and inscriptions are not part of the map (this is not obvious). Can you describe the whole picture right away? You waste your time and other users ' time - P. Ilyin

    Make two blocks, one hidden (through the property hidden). When you click on the button that is hidden, make visible. And the second - on the contrary hide.