MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / initScrolling

Method initScrolling

code/main/RenderLocation.ts:72–92  ·  view source on GitHub ↗
(defaultScroll: number)

Source from the content-addressed store, hash-verified

70 }
71
72 private initScrolling(defaultScroll: number): void{
73 // Scroll to the default scroll
74 $("html").scrollTop(defaultScroll);
75
76 // Set css for our location string
77 $(this.locationString).css({
78 'position' : 'absolute',
79 'left' : '0', // With this, the scrolling place (the map for example) is sticked to the left of the page
80 'top' : '0', // With this, the scrolling place (the map for example) go below the status bar
81 'overflow-x' : 'scroll'
82 });
83
84 // Set css for around the status bar
85 $("#aroundStatusBar").css({
86 'position' : 'fixed',
87 'top' : '0',
88 'left' : '0',
89 'right' : '0',
90 'height' : '0'
91 });
92 }
93
94 private stopScrolling(): void{
95 // Set the scroll to 0

Callers 1

setScrollingMethod · 0.95

Calls 3

$Function · 0.85
scrollTopMethod · 0.80
cssMethod · 0.65

Tested by

no test coverage detected