scrollToElement

Scrolls the page to the specified element.

Syntax

scrollToElement = function(aElement, aScrollMethod);

Parameters

  • aElement
    • functions: element up to which scrolling has to be made
  • aScrollMethod
    • functions: scrolling method

Returned value

  • functions: flag of the operation success

Examples

  1. //Obtain a random element with tag "img"
    var element = getElement('img');
    //Emulating scroll to the element
    scrollToElement(element);