html - Change the height of the containing div according to sliding down tree menu items -


I have a tree menu in the left hand of the website and it is as follows.

  & lt; Div id = "left_menu" & gt; & Lt; Ul id = "tree menu" & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Rev. Message from Surangi Fernando & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; 125th anniversary & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; 200th Anniversary & lt; / A & gt; & Lt; / Li & gt; & Lt; Li class = "content container" & gt; & Lt; A href = "#" & gt; Church & lt; / A & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Chalupotha & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Negombo & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Andiambalama & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Pitfona & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Amandoluva & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt;  

used jquery

$ (document) .ready (function () {// Class 'contentContainer' means 'li' with children. // default by 'contentcontainer' child, To display: None '$ ("# treeMenu li") Toggle (function () {// Start first click function $ (this). Children (' 'ul'). ($ (This) .hasClass ( 'Contentcontainer'). $ (This) .removeClass ('contentcontainer'). AddClass ('see content');}}, // END FIRST CLICK function function () {// start second click function $ (this). Children ('ul') SlideUp () ($ (this) .hasClass ('Content View')) {$ (this) .rem OveClass ('content view') .addClass ('contentcontainer');}} / / second second click function), // and toggle function}); // END document ready

This is CSS.

  #left_menu {margin-top: 5px; Margin-right: 5px; Padding-down: 5px; Color: #ffffff; Swim left; Status: Relative; Border: 1px solid brown; Range radius: 15px; } #left_manu_al {paging: 0; Swim left; } # Left_manu li {list-style: none; Display area; Border bottom: 1px dashed; Margin: 5 px; Padding: 0; } #left_manu_l_a {width: 305px; Padding: 10px 10px 10px 15px; Display: Inline-block; } #left_menu ul li ul {display: none; Status: Completed; Margin: 0; Padding: 0; } # Left_manu li ul li {clear: both; Border bottom: 1px dashed; Padding: 0; Margin: 0; } #left_manu li ul li {width: 280px; Padding-left: 40px; } # Left_menu Lee: hover {background: url (../images/NEW_bug.); }  

This code inside the church li tag is not visible in the ul tag. This invisible tag is fully deployed when we click on the churches, it slides down but the height of the container DIV #left_menu is not changing. How can I solve this problem?

You deploy #left_menu ul li ul as a relative, And add a maximum-width of 340px to #left_menu

:


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -