admin管理员组文章数量:1122846
How can I implement zoom functionality for a swiper element in Angular 17? I followed this approach to use swiper elements in my Angular project. I tried adding the zoom property in the same way as pagination. The pagination property works, but the zoom property has no effect: <swiper-container [pagination]="{ clickable: true }" [zoom]="true">
.
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
template: `
<p>Swipe to change slides</p>
<swiper-container>
<swiper-slide>Slide 1</swiper-slide>
<swiper-slide>Slide 2</swiper-slide>
<swiper-slide>Slide 3</swiper-slide>
<swiper-slide>Slide 4</swiper-slide>
</swiper-container>`,
styles: [
`swiper-slide {
height: 400px
}
swiper-slide:nth-of-type(1) {
background-color: red;
}
swiper-slide:nth-of-type(2) {
background-color: green;
}
swiper-slide:nth-of-type(3) {
background-color: blue;
color: white;
}
swiper-slide:nth-of-type(4) {
background-color: yellow;
}`,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class App {}
StackBlitz
本文标签: swiperjsAngular 17 swiper element zoomStack Overflow
版权声明:本文标题:swiper.js - Angular 17 swiper element zoom - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736306934a1933137.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论