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 "location.hash" and "on hashchange" Here is code i use for expanding/collapsing multilevel divs on my site:
$(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() {
});
});
Will be happy to any help. Thanks in advance!