Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to expand multilevel divs with javascript and save expanded condition in url for links sharing or manual copy/past
    primarykey
    data
    text
    <p>Hi to all javascript pros! I search solution for expanding multilevel divs which contains links to doc/pdf files with posibility to copy/past or share url links in expanded condition. I am a total newbie with javascript and not sure wich way it can be realized. May be something like "<strong>location.hash</strong>" and "<strong>on hashchange</strong>" Here is code i use for expanding/collapsing multilevel divs on my site:</p> <pre><code>$(document).ready(function(){ $('.lib_element_sign_pos').toggle(function() { $(this).css("background-image", "url('/images/-.png')"); if($(this).parent().parent().attr('class') == "lib_level_1") $(this).parent().parent().find('.lib_level_2').slideDown('slow'); else if($(this).parent().parent().attr('class') == "lib_level_2") $(this).parent().parent().find('.lib_level_3').slideDown('slow'); } , function() { $(this).css("background-image", "url('/images/+.png')"); if($(this).parent().parent().attr('class') == "lib_level_1") $(this).parent().parent().find('.lib_level_2').hide(); else if($(this).parent().parent().attr('class') == "lib_level_2") $(this).parent().parent().find('.lib_level_3').hide(); }); $('.lib_element_text').toggle(function() { $(this).parent().find('.lib_element_sign_pos').css("background-image", "url('/images/-.png')"); if($(this).parent().parent().attr('class') == "lib_level_1") $(this).parent().parent().find('.lib_level_2').slideDown('slow'); else if($(this).parent().parent().attr('class') == "lib_level_2") $(this).parent().parent().find('.lib_level_3').slideDown('slow'); } , function() { $(this).parent().find('.lib_element_sign_pos').css("background-image", "url('/images/+.png')"); if($(this).parent().parent().attr('class') == "lib_level_1") $(this).parent().parent().find('.lib_level_2').hide(); else if($(this).parent().parent().attr('class') == "lib_level_2") $(this).parent().parent().find('.lib_level_3').hide(); }); $('.lib_element_about').click(function() { if($(this).next().css('display') == 'none') $(this).next().slideDown('100000'); else $(this).next().hide(); $('#lib_area').find('.lib_element_info').hide(); } , function() { }); </code></pre> <p>});</p> <p>Will be happy to any help. Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload