Good day!

On sites based on the wiki engine Wikimedia in the "Content" section there is a paragraph-link "[remove]":

enter image description here

I can not add this thing to my site, the code is copicopted, something does not work. Tell me, please, what am I doing wrong?

That code:

<nav id="toc" class="toc show"> <div id="toctitle"> <h2></h2> <span class="toctoggle"> [ <a id="togglelink" class="internal" data-hide="убрать" data-show="показать" href="#" title="убрать"></a> ] </span> </div> <ol></ol> </nav> 

    1 answer 1

    Well, since I certainly can’t wait to lay out my thoughts between the <head> tags

     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script><script src="script.js"></script> 

    in the root of the site create script.js

    in him

     jQuery(document).ready(function() { jQuery('#togglelink.internal').live('click',function{ jQuery(this).removeClass("internal"); jQuery(this).addClass("active"); var link = jQuery(this).attr("data-hide"); jQuery(this).html(link); jQuery('селектор блока который надо расскрыть).addClass("activeDiv") }); jQuery('#togglelink.active').live('click',function{ jQuery(this).removeClass("active"); jQuery(this).addClass("internal"); var link = jQuery(this).attr("data-show"); jQuery(this).html(link); jQuery('селектор блока который надо расскрыть').removeClass("activeDiv") }); 

    css

     ('селектор блока который надо расскрыть'){ height:300px;} ('селектор блока который надо расскрыть').activeDiv{ height:auto;} 

    This is if the block is a block (div, p, etc.) sorry for taftology.

    }

    • Thanks uncle, it helped - Mahdi735
    • You need the full code, put the html-code. I'll tell you. - Sergalas