pub struct UseScrollOptions { /* private fields */ }
Expand description
Options for use_scroll
.
Options for use_scroll_with_options
.
Implementations§
Source§impl UseScrollOptions
impl UseScrollOptions
Sourcepub fn throttle(self, value: f64) -> Self
pub fn throttle(self, value: f64) -> Self
Throttle time in milliseconds for the scroll events. Defaults to 0 (disabled).
Sourcepub fn idle(self, value: f64) -> Self
pub fn idle(self, value: f64) -> Self
After scrolling ends we wait idle + throttle milliseconds before we consider scrolling to have stopped. Defaults to 200.
Sourcepub fn offset(self, value: ScrollOffset) -> Self
pub fn offset(self, value: ScrollOffset) -> Self
Threshold in pixels when we consider a side to have arrived (UseScrollReturn::arrived_state
).
Sourcepub fn on_scroll(self, value: impl Fn(Event) + 'static) -> Self
pub fn on_scroll(self, value: impl Fn(Event) + 'static) -> Self
Callback when scrolling is happening.
Sourcepub fn on_stop(self, value: impl Fn(Event) + 'static) -> Self
pub fn on_stop(self, value: impl Fn(Event) + 'static) -> Self
Callback when scrolling stops (after idle
+ throttle
milliseconds have passed).
Sourcepub fn event_listener_options(self, value: UseEventListenerOptions) -> Self
pub fn event_listener_options(self, value: UseEventListenerOptions) -> Self
Options passed to the addEventListener("scroll", ...)
call
Sourcepub fn behavior(self, value: impl Into<MaybeSignal<ScrollBehavior>>) -> Self
pub fn behavior(self, value: impl Into<MaybeSignal<ScrollBehavior>>) -> Self
When changing the x
or y
signals this specifies the scroll behaviour.
Can be Auto
(= not smooth) or Smooth
. Defaults to Auto
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UseScrollOptions
impl !RefUnwindSafe for UseScrollOptions
impl !Send for UseScrollOptions
impl !Sync for UseScrollOptions
impl Unpin for UseScrollOptions
impl !UnwindSafe for UseScrollOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more