Table of Contents

Class ScrollManager

Namespace
MudBlazor
Assembly
MudBlazor.dll
public class ScrollManager : IScrollManager
Inheritance
ScrollManager
Implements
Inherited Members
Extension Methods

Constructors

ScrollManager(IJSRuntime)

public ScrollManager(IJSRuntime jSRuntime)

Parameters

jSRuntime IJSRuntime

Methods

LockScrollAsync(string, string)

public ValueTask LockScrollAsync(string selector = "body", string cssClass = "scroll-locked")

Parameters

selector string
cssClass string

Returns

ValueTask

ScrollIntoViewAsync(string, ScrollBehavior)

Scrolls the first instance of the selector into view.

public ValueTask ScrollIntoViewAsync(string selector, ScrollBehavior behavior)

Parameters

selector string
behavior ScrollBehavior

Returns

ValueTask

ScrollToAsync(string, int, int, ScrollBehavior)

Scrolls to the coordinates of the element.

public ValueTask ScrollToAsync(string id, int left, int top, ScrollBehavior behavior)

Parameters

id string

id of element

left int

x coordinate

top int

y coordinate

behavior ScrollBehavior

smooth or auto

Returns

ValueTask

ScrollToBottomAsync(string, ScrollBehavior)

Scroll to the bottom of the element (or if not found to the bottom of the page).

public ValueTask ScrollToBottomAsync(string id, ScrollBehavior behavior)

Parameters

id string

id of element of null to scroll to page bottom

behavior ScrollBehavior

smooth or auto

Returns

ValueTask

ScrollToListItemAsync(string)

public ValueTask ScrollToListItemAsync(string elementId)

Parameters

elementId string

Returns

ValueTask

ScrollToTopAsync(string, ScrollBehavior)

Scrolls to the top of the element.

public ValueTask ScrollToTopAsync(string id, ScrollBehavior scrollBehavior = ScrollBehavior.Auto)

Parameters

id string

id of element

scrollBehavior ScrollBehavior

smooth or auto

Returns

ValueTask

ScrollToYearAsync(string)

public ValueTask ScrollToYearAsync(string elementId)

Parameters

elementId string

Returns

ValueTask

UnlockScrollAsync(string, string)

public ValueTask UnlockScrollAsync(string selector = "body", string cssClass = "scroll-locked")

Parameters

selector string
cssClass string

Returns

ValueTask