#[repr(C)]pub struct ScrollIntoViewOptions {
pub block: ScrollLogicalPosition,
pub inline_axis: ScrollLogicalPosition,
pub behavior: ScrollIntoViewBehavior,
}Expand description
W3C-compliant scroll-into-view options
These options control how an element is scrolled into view, following the CSSOM View Module specification.
Fields§
§block: ScrollLogicalPositionVertical alignment: start, center, end, nearest (default: nearest)
inline_axis: ScrollLogicalPositionHorizontal alignment: start, center, end, nearest (default: nearest)
Note: Named inline_axis to avoid conflict with C keyword inline
behavior: ScrollIntoViewBehaviorAnimation behavior: auto, instant, smooth (default: auto)
Implementations§
Source§impl ScrollIntoViewOptions
impl ScrollIntoViewOptions
Sourcepub fn end() -> Self
pub fn end() -> Self
Create options to align the end of the target with the end of the viewport
Sourcepub fn with_instant(self) -> Self
pub fn with_instant(self) -> Self
Set instant scroll behavior
Sourcepub fn with_smooth(self) -> Self
pub fn with_smooth(self) -> Self
Set smooth scroll behavior
Trait Implementations§
Source§impl Clone for ScrollIntoViewOptions
impl Clone for ScrollIntoViewOptions
Source§fn clone(&self) -> ScrollIntoViewOptions
fn clone(&self) -> ScrollIntoViewOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScrollIntoViewOptions
impl Debug for ScrollIntoViewOptions
Source§impl Default for ScrollIntoViewOptions
impl Default for ScrollIntoViewOptions
Source§fn default() -> ScrollIntoViewOptions
fn default() -> ScrollIntoViewOptions
Returns the “default value” for a type. Read more
Source§impl Hash for ScrollIntoViewOptions
impl Hash for ScrollIntoViewOptions
Source§impl PartialEq for ScrollIntoViewOptions
impl PartialEq for ScrollIntoViewOptions
impl Copy for ScrollIntoViewOptions
impl Eq for ScrollIntoViewOptions
impl StructuralPartialEq for ScrollIntoViewOptions
Auto Trait Implementations§
impl Freeze for ScrollIntoViewOptions
impl RefUnwindSafe for ScrollIntoViewOptions
impl Send for ScrollIntoViewOptions
impl Sync for ScrollIntoViewOptions
impl Unpin for ScrollIntoViewOptions
impl UnwindSafe for ScrollIntoViewOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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