Home > Web Front-end > HTML Tutorial > I have a question about the div scroll bar_html/css_WEB-ITnose

I have a question about the div scroll bar_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:39:56
Original
1609 people have browsed it

代码如下:



    
    
    CDOS Mail
    


<script> <br>     $(document).ready(function() { <br>         $(".newfolder").show(); <br>         $(".rcvfold").click(function(){ <br>                  $('.newfolder').slideToggle(500); <br>         }) <br>     }); <br> </script>


    
欢迎新用户

    
收件箱

    

        
        
        
        
        
        
        
        
        
        
        
    

;

testaaaaaasdasdasdasdsdas


>

testaaaaaasdasdasdasdsdas






Create a div inside a div, outside There is a button in the layer div. Click it to expand/retract the content of the inner layer div. The original effect is: if the inner layer div is set to a certain size, if it can display 4 lines of content test1~4, a scroll bar will appear if there is still content. .

The current problem is that if you add the first sentence , the scroll bar will not appear in the vertical direction of the inner div, but it will not affect the horizontal direction. If there is too much content, it will You can’t view it when you go to the bottom of the page.

If you log out the first sentence , the scroll bar can appear in the inner div, but when you click to shrink, the content of the inner div shrinks but the border remains


Please tell me how to modify the combination of the two situations of solid line, that is, click the button to pull down the solid line, and then the scroll bar will appear, click the button again and the div will pull up as a whole, thank you

Reply to discussion (solution)

Expand the effect after commenting on the first sentence:


Change it here to this, and then you Set the height of #innerOne to a fixed height

$(document).ready(function() {        $("#innerOne .newfolder").show();        $(".rcvfold").click(function(){                 $('#innerOne').slideToggle(500);        })    });
Copy after login
Copy after login

You change it like this here, and then you set the height of #innerOne to a fixed height

$(document).ready(function() {        $("#innerOne .newfolder").show();        $(".rcvfold").click(function(){                 $('#innerOne').slideToggle(500);        })    });
Copy after login
Copy after login

Thank you very much
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template