How to use the swiper/dist/js/swiper function in swiper

To help you get started, we’ve selected a few swiper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GitOfZGT / zero-design / zerod / components / Zscheduling / index.jsx View on Github external
componentDidMount() {
		//将methods对象通过exportMethods导出去
		this.props.exportMethods && this.props.exportMethods(this.methods);
		this.methods.updateSize();
		removeClass(this.checkboxEl, "z-scheduling-hidden");
		removeClass(this.contentEl, "z-scheduling-hidden");
		this.swiper = new Swiper(this.swiperElement, {
			autoplay: false,
			direction: "horizontal",
			loop: false,
			shortSwipes: false,
			longSwipesRatio: 0.05,
			longSwipesMs: 100,
			grabCursor: false,
			speed: 1200,
			pagination: {
				el: this.swiperPaginationEl,
				clickable: true,
				// type : 'custom',
				// renderCustom:(swiper, current, total)=>{

				// }
			},
github GitOfZGT / zero-design / zerod / components / Zswiper / index.jsx View on Github external
createSwiper() {
		const { pagination, navigation, ...others } = this.props.swiperOptions;
		if (pagination) {
			pagination.el && delete pagination.el;
		}
		if (navigation) {
			navigation.nextEl && delete navigation.nextEl;
			navigation.prevEl && delete navigation.prevEl;
		}
		return new Swiper(this.swiperElement, {
			autoplay: true,
			loop: false,
			// 如果需要分页器
			pagination:
				pagination === false
					? pagination
					: {
							el: this.paginationElement,
							...(pagination ? pagination : {}),
					  },
			// 如果需要前进后退按钮
			navigation:
				navigation === false
					? navigation
					: {
							nextEl: this.nextElement,
github kidjp85 / react-id-swiper / src / index.js View on Github external
buildSwiper() {
    this.swiper = new Swiper(ReactDOM.findDOMNode(this), objectAssign({}, this.props));
  }