Moving end sass / scss swiper iscroll rem agax elastic box

A, Sass / SCSS
Ruby language

1.scss变量
	$w:300px;$h:235px;
	.mm{width:$w;height:$h;}
2.sass的嵌套写法:
	.header{ height:200px;
	    h1{font-size:18px}
	}

Two, swiper.js
carousel
1. Load swiper.min.css style file at page
2. Load swiper.min.js file
3. Write html structure

<div class="swiper-container baaner">
			<div class="swiper-wrapper">
				<div class="swiper-slide"><img src="img/img1.jpg" ></div>
				<div class="swiper-slide"><img src="img/img2.jpg" ></div>
				<div class="swiper-slide"><img src="img/img3.jpg" ></div>
				<div class="swiper-slide"><img src="img/img4.jpg" ></div>
				<div class="swiper-slide"><img src="img/img5.jpg" ></div>
			</div>
			<div class="swiper-pagination">分页器</div>
			<div class="swiper-button-prev">后进</div>
			<div class="swiper-button-next">前进</div>
			<div class="swiper-scrollbar"></div>
		</div>
4.写javascript脚本
	var mswiper=new Swiper("#mm",{
		direction:"vertical",   //垂直方向   默认水平 (不需要垂直注释即可)
		autoplay:2000,	  //自动播放
		loop:true,	  //循环
		speed:1000,	  //展示速度
		pagination:".swiper-pagination",	//分页器
		prevButton:".swiper-button-prev",	//后退
		nextButton:".swiper-button-next"	//前进
	})

Three, iScroll.js:
Load iscroll.js file
1.html structure

<div class="box" style="height:3rem">
			<div class="content" style="padding:50px 0" >
				滚动内容
			</div>
		</div>
 注:设置css样式时box的高度必须小于content高度
2.js结构:
	//禁用浏览自带默认touchmove事件
	document.addEventListener("touchmove",function(ev){
		ev.preventDefault()
	},{
	 passive:false}
	)
     var mscroll=new IScroll(".box",{
		scrollX:true,		//水平滑动
		scrollY:true,   //垂直滑动
	});

Four, ajax:

 1   $.ajax({
		url:"http://www.abc.com/reg.php?uname=李宝裤&usex=先生",
		type:"get/post",
		success:function(msg){
			//msg为返回的数据
		}
	})


2  $.get(url,{},function(){},"json")	
http://www.abc.com/reg.php?uname=李宝裤&usex=先生
$.get("http://www.abc.com/reg.php",{uname:"李宝裤",usex:"先生"}
	,function(msg){
		//msg为返回的数据
		}
     ,"json")

  3   $.post(url,{},function(){},"json")//与get一样

Five, rem: general default 1rem = 16px;
dynamic setting rem

function  rem(){
	document.documentElement.style.fontSize=document.documentElement.clientWidth/7.5+"px";
 }
  rem();
//事件  onresize当屏幕的尺寸发生改变的时候会触发该事件
window.rem;

Sixth, the elastic box:

diplay: flex; // define an elastic cassette
flex-direction: row | row- reverse | column | column-reverse; // the specified position of the elastic element in the child's parent container.
flex-wrap: wrap // beyond the wrap
align-items: flex-start | flex-end | center | baseline | stretch // set or retrieve an elastic element cartridge alignment in the direction of the side shaft (vertical axis).
justify-content: flex-start | flex-end | center | space-between | space-around // Align contents
flex-grow: 0 // defines the ratio of the elastic extension box element.
flex-shrink: the elastic shrinkage ratio of 1 // define the box element.
order: Number; (custom) // Sort the elements of the elastic sub

Guess you like

Origin blog.csdn.net/qq_44306441/article/details/89017108