ComponentOne SuperPanel for ASP.NET AJAX: SuperPanel Behavior > Scrolling Elements

Scrolling Elements

You can specify what and where to scroll elements within SuperPanel using the ScrollTo, ScrollToChild, and ScrollOffset methods.

You can use any of the following ways to specify the target position:

      A hash {top:x, left:y}, x and y can be any kind of number string

      The string "max" to scroll to the end

      A string such as "100", "100px", "+=15px", etc

      A child element of the scrollable element

Scrolling to a Location within SuperPanel

You can specify what to scroll by simply calling the name of the object or element you want to be scrolled. For example you can use the ScrollTo method for scrolling to a specific location in the SuperPanel.

 

<script language="javascript" type="text/javascript">

        function scrollTo() {

            var scroll = $find('<%=C1SuperPanel1.ClientID %>');

            scroll.get_panelBehavior().scrollTo(300, 200);

        }

 

    </script>

Scrolling to a child element within SuperPanel

You can use the scrollToChild method to scroll to a child element in the SuperPanel.

 

<script language="javascript" type="text/javascript">

        function scrollToChild() {

            var scroll = $find('<%=C1SuperPanel1.ClientID %>');

            var d = $get('t1');

            d.style.border = "1px solid red";

            scroll.get_panelBehavior().scrollToChild(d);

        }

    </script>

Scrolling to offset parameters

You can use the scrollOffset method to scroll the SuperPanel to a specified position along the XAxis, YAxis or both based on the specified offset parameters.

 

<script language="javascript" type="text/javascript">

        function scrollOffSet() {

            var scroll = $find('<%=C1SuperPanel1.ClientID %>');

            scroll.get_panelBehavior().scrollOffset(100, 100);

        }

    </script>


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.