ASP.NET Slide Menu - Knowledge Base

« Back to Knowledge Base list

How to set dynamic height for slide menu from client-side?

Q:

How to set dynamic height for slide menu from client-side?

A:

To set the height dynamically from client-side, the height need to be assigned through the slide menu client side object, which can be accessed by oboutSM{id} object where {id} indicates the ID of the slide menu. A JavaScript function will be invoked to set the height on load of the page. The operation can be done as follows:

        <script type="text/javascript">
            window.onload= function()
            {
                if(oboutSMpro_5.O1)
                {
                    setTimeout(function(){
                    document.getElementById(oboutSMslideMenu.id).style.height = '300px';}
                    , 200);
                }
            }
        </script>
        <osm:SlideMenu ID = "slideMenu" runat = "server" ...>

                ...
        <osm:SlideMenu>