Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
How to scroll and select client side
posted

Hi. How can i scroll to an image and select it using javascript?

 I tried using

var iv2 = $find("<%=WebImageViewer2.ClientID %>");

iv2.set_selectedItem(index);

 but it doesn't scroll to image. Is it possible to achieve this?

 Greetings

  • 40030
    Offline posted

    There is a sample in our samples browser that shows exactly how to do this:

     https://ko.infragistics.com/samples/aspnet/image-viewer/client-side-events

    Under Aikido/WebImageViewer: Both the "Customizing the Header" and "Client-Side Events" samples use this method:

     

    var item = imageViewer.get_items().getItem(  4 );

    imageViewer.get_scrollAnimations().get_nextItemAnimation().moveItemIntoFocus(item);

    The code above shows how to scroll the 5th item into view.

    Hope this helps:

    -SteveZ