Articles in this section
Category / Section

How to handle the height of the navigation drawer?

1 min read

The height of the navigation drawer can be handled by its parent element. Navigation drawer can be appended either to the page or to its parent. This can be achieved by the position property that takes a value fixed or normal and appends the drawer to the page or to its parent respectively.

Since navigation drawer is a layout control, it is set with the height based on its parent element. By default, the control is rendered with fixed position respective to the page. So, to handle the height of the navigation drawer, create one wrapper div and set the height for the same. After creating the element, render the navigation drawer by setting the position property to normal. Now, the navigation drawer renders with the height of the wrapper element that is set in the wrapper. Refer to the following code example.

HTML

<div class="header">
        <div id="header">
            Home
        </div>
    </div>

  <div class="navwrapper">

        <div data-role="ejnavigationdrawer" data-ej-targetid="header" id="tempnavpane" data-ej-position="normal">

            <!--Place your control here-->

            <div class="defaultsample">

                <div id="Div1" data-role="ejtile" data-ej-tilesize="medium" data-ej-imageurl='themes/images/tileview/alerts.png'

                     data-ej-text="Alerts">

                </div>

                <div id="Div2" data-role="ejtile" data-ej-tilesize="medium" data-ej-imageurl='themes/images/tileview/camera.png'

                     data-ej-text="Camera">

                </div>

                <div id="Div3" data-role="ejtile" data-ej-tilesize="medium" data-ej-imageurl='themes/images/tileview/games.png'

                     data-ej-text="Games">

                </div>

                <div id="Div4" data-role="ejtile" data-ej-tilesize="medium" data-ej-imageurl='themes/images/tileview/map.png'

                     data-ej-text="Map">

                </div>

                <div id="Div5" data-role="ejtile" data-ej-tilesize="medium" data-ej-imageurl='themes/images/tileview/messages.png'

                     data-ej-text="Messages">

                </div>

                <div id="Div6" data-role="ejtile" data-ej-tilesize="medium" data-ej-imageurl='themes/images/tileview/music.png'

                     data-ej-text="Music">

                </div>

            </div>

        </div>

    </div>

CSS

<style>

        .navwrapper {

            display: block;

            height: 325px;

            position: relative;

        }

    </style>

The following screenshot displays the output.

Navigation drawer

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied