H5页面实现原理分析分享

用户头像
上海/产品设计师/10年前/911浏览
H5页面实现原理分析分享

大家一起试试吧

站酷网显示问题:<script>没有空格,黏贴好后记得删掉

<!doctype html>

<html>

<head>

<style>

html{overflow:hidden;}

body{ margin:0;}

.w img{width:100%;height:100%;}

</style>

<s cript src="js/jquery.js"> </s cript>

<meta charset="utf-8">

<title>H5页面实现原理分析</title>

</head>


<body>

<div class="w">

<div><img src="images/001.jpg"></div>

<div><img src="images/002.jpg"></div>

<div><img src="images/003.jpg"></div>

<div><img src="images/004.jpg"></div>

</div>

<s cript>

var wHeight=$(window).height();

$(".w div").height(wHeight);

var n=0;

$("body").click(function(){

if(n<$(".w div").length-1){

n=n+1;

}else{

$(".w").css({marginTop:0});

n=1;

}

$(".w").stop().animate({marginTop:-wHeight*n});

})

$(window).resize(function(){

wHeight=$(window).height();

$(".w div").height(wHelght);

$(".w").css({marginTop:-wHeight*n});

})

</s cript>

</body>

</html>


5
举报
|
5
分享
评论
用户头像
评论你的想法~
表情
喜欢TA的作品吗?喜欢就快来夸夸TA吧!
加载中
推荐素材
抽象液态渐变UI背景模版
新拟态风格 UI设计组件库
原创UIUX交互橙红渐变炫酷视觉平面设计作品集模板PSD
UI通用设计素材1
新能源APP应用UIKit
UI界面 组件
UI应用平面图标
科技医疗透明柜UI界面设计
【新年UI图标】秒杀icon
钱包ui模板
Security Camera UI kit
【新年UI图标】汽车icon
高级表盘系列UI源文件
盲盒APP UI设计
【新年UI图标】影音icon
【新年UI图标】会员icon
【新年UI图标】30个图标
3D卡通UI界面图标可爱插画免扣素
手表表盘UI系列
高级感金属拟物 UI设计组件库
【新年UI图标】珠宝icon
【新年UI图标】银行卡icon
拟物风质感写实UI卡片合集源文件
你可能喜欢
大家都在看
登录注册