Skip to content

Commit

Permalink
Scroll Move Added.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadyNagy committed Aug 3, 2020
1 parent 03ac45d commit 2fa5764
Show file tree
Hide file tree
Showing 20 changed files with 1,782 additions and 34 deletions.
16 changes: 15 additions & 1 deletion samples/blazor-sample/Pages/ScrollbarController.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@inject IBlazorScrollController BlazorScrollController

<div style="width: 2000px; height: 2000px;">
<div id="test" class="test" style="width: 2000px; height: 2000px;">
<button class="btn btn-danger" @onclick="HideScrollVertical">Hide Scroll Vertical</button>
<button class="btn btn-primary" @onclick="ShowScrollVertical">Show Scroll Vertical</button>

Expand All @@ -11,6 +11,10 @@

<button class="btn btn-danger" @onclick="HideScrollBoth">Hide Scroll Both</button>
<button class="btn btn-primary" @onclick="ShowScrollBoth">Show Scroll Both</button>

<button class="btn btn-primary" @onclick="ScrollToTop" style="position: fixed">Scroll To Top</button>
<button class="btn btn-primary" @onclick="ScrollToBottom" style="position: fixed;top: 120px;">Scroll To Bottom</button>

</div>

@code
Expand Down Expand Up @@ -44,4 +48,14 @@
{
await BlazorScrollController.ShowBodyScrollOverflowAsync(ScrollType.Both);
}

private async Task ScrollToTop()
{
await BlazorScrollController.ScrollToBodyTopAsync(ScrollBehaviors.Auto);
}

private async Task ScrollToBottom()
{
await BlazorScrollController.ScrollToBodyBottomAsync( ScrollBehaviors.Auto);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,34 @@ internal static class ScrollController
internal static string ShowScrollOverflowByTag => "showScrollOverflowByTag";
internal static string HideScrollOverflowByClass => "hideScrollOverflowByClass";
internal static string ShowScrollOverflowByClass => "showScrollOverflowByClass";
internal static string ScrollTo => "mainScrollTo";
internal static string ScrollVToElementById => "scrollVToElementById";
internal static string ScrollVToElementByTag => "scrollVToElementByTag";
internal static string ScrollVToElementByClass => "scrollVToElementByClass";
internal static string ScrollHToElementById => "scrollHToElementById";
internal static string ScrollHToElementByTag => "scrollHToElementByTag";
internal static string ScrollHToElementByClass => "scrollHToElementByClass";
internal static string ScrollElementToByTagName => "scrollElementToByTagName";
internal static string ScrollElementToByElementId => "scrollElementToByElementId";
internal static string ScrollElementToByClassName => "scrollElementToByClassName";
internal static string GetScrollHeightByElementId => "getScrollHeightByElementId";
internal static string GetScrollHeightByTagName => "getScrollHeightByTagName";
internal static string GetScrollHeightByClassName => "getScrollHeightByClassName";
internal static string GetScrollWidthByElementId => "getScrollWidthByElementId";
internal static string GetScrollWidthByTagName => "getScrollWidthByTagName";
internal static string GetScrollWidthByClassName => "getScrollWidthByClassName";
internal static string GetScrollLeftByElementId => "getScrollLeftByElementId";
internal static string GetScrollLeftByTagName => "getScrollLeftByTagName";
internal static string GetScrollLeftByClassName => "getScrollLeftByClassName";
internal static string GetScrollTopByElementId => "getScrollTopByElementId";
internal static string GetScrollTopByTagName => "getScrollTopByTagName";
internal static string GetScrollTopByClassName => "getScrollTopByClassName";
internal static string SetScrollLeftByElementId => "setScrollLeftByElementId";
internal static string SetScrollLeftByTagName => "setScrollLeftByTagName";
internal static string SetScrollLeftByClassName => "setScrollLeftByClassName";
internal static string SetScrollTopByElementId => "setScrollTopByElementId";
internal static string SetScrollTopByTagName => "setScrollTopByTagName";
internal static string SetScrollTopByClassName => "setScrollTopByClassName";
}

internal static class Storage
Expand Down
Loading

0 comments on commit 2fa5764

Please sign in to comment.