There is a div element with a php function inside.

In general, I wanted the div element to disappear along with the php-function at a small scale, and a button would appear when clicked, which opened the div element with the php-function as a slider (as in Vkontakte on the phone).

How can I solve this problem. They disappear with the help of classes in bootstrap (visible-lg, etc.)

Closed due to the fact that the essence of the question is not clear to the participants by Denis Bubnov , Denis , Vadim Ovchinnikov , user194374, Akina 3 Feb '17 at 9:41 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Write in more detail what you want. And the screenshots are not convenient to watch. - EmptyMan

1 answer 1

Everything is very simple. When clicking on the button, remove the class blocking the display of the object:

$('#hiddenblock').toggleClass("visible-lg-block");//показать-скрыть 

or

 $('#hiddenblock').removeClass("visible-lg-block");//только показать 

Then delete the button if necessary:

 $(this).remove(); 

 $('#show').click(function(){ $('#hiddenblock').toggleClass("visible-lg-block"); }) $('#showandremove').click(function(){ $('#hiddenblock').removeClass("visible-lg-block"); $(this).remove(); }) 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <button id="show" class="hidden-lg"> Показать/скрыть блок </button> <button id="showandremove" class="hidden-lg"> Показать и убрать кнопку </button> <div id="hiddenblock" class="visible-lg-block"> Контент, спрятанный на мобильной версии </div>