#[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 nearest() -> ScrollIntoViewOptions
pub fn nearest() -> ScrollIntoViewOptions
Create options with “nearest” alignment for both axes
Sourcepub fn center() -> ScrollIntoViewOptions
pub fn center() -> ScrollIntoViewOptions
Create options with “center” alignment for both axes
Sourcepub fn start() -> ScrollIntoViewOptions
pub fn start() -> ScrollIntoViewOptions
Create options with “start” alignment for both axes
Sourcepub fn end() -> ScrollIntoViewOptions
pub fn end() -> ScrollIntoViewOptions
Create options to align the end of the target with the end of the viewport
Sourcepub fn with_instant(self) -> ScrollIntoViewOptions
pub fn with_instant(self) -> ScrollIntoViewOptions
Set instant scroll behavior
Sourcepub fn with_smooth(self) -> ScrollIntoViewOptions
pub fn with_smooth(self) -> ScrollIntoViewOptions
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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