Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a image that on hover slides down with content and again on hover slides up.

But the problem is, it slides down the entire div instead of just sliding down the panel.

JavaScript
<script type="text/javascript">
function toggleslider() {
    if ($("#panelThatSlides").is(":visible")) {
        $("#contentThatFades").animate(
            {
                opacity: "0"
            },
            600,
            function(){
                $("#panelThatSlides").slideUp();
            }
        );
    }
    else {
        $("#panelThatSlides").slideDown(600, function(){
            $("#contentThatFades").animate(
                {
                    opacity: "1"
                },
                600
            );
        });
    }   
}
</script>



Any suggestions?

Thanks
Posted
Comments
Sk. Tajbir 20-Dec-12 6:47am    
Can you share HTML code for this div and panel ?
Keith Barrow 20-Dec-12 7:01am    
As Sk Tajbir suggests, the relevant bit of the HTML would help.

As and aside, there is also a slide toggle you might find useful http://api.jquery.com/slideToggle/
vinodkumarnie 19-Jan-13 6:56am    
Need HTML source code... Plz post the same..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900