特别赶,响应式纯自适应的,有空写了新的发。 (在手机上看,页面上看一定乱)

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="UTF-8">
<meta content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta http-equiv="Cache-Control" content="no-transform ">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<script src="jquery-1.9.1.js"></script>
<title>无缝连接滚动</title>
<style>
html,body,ul,li{
margin:0; padding:0;
}
a{
text-decoration:none;
}
#s_height ul li{
z-index:9;
list-style-type:none;
float:left;
overflow:hidden;
display:black;
}

#d_Layout ul li{
list-style-type:none;
float:left;
text-align:center;
}
#d_cilck{
width:100%;
}
#s_us{
right:20px; position:absolute; margin-top:-25px; z-index:999;
}
#s_us ul li{
list-style-type:none;
float:left;
padding-left:15px;
}
#s_us ul li{
margin-left:15px;
border-radius:25px; border:2px solid #ffffff;padding:5px;
}

</style>

</head>

<script>

$(function(){
var t_name={
t_lb:$("#s_Shell ul li"),
s_h:$("#s_height"),
Carousel_img:$("#s_heights ul li"),
Carousel_imgs:$("#s_heights ul li img"),
s_Sc:$("#Seamless_carousel"),
s_ul:$("#s_us ul li"),
s_slM:$(".slider-mains")
};

//全局变量,触摸开始位置
var startX=0,startY=0,x=0,i=2,c=3,sWidths= t_name.s_h.width();
//touchstart事件 在触摸开始时触发事件
function touchSatrtFunc(evt){
try
{
//evt.preventDefault(); //阻止触摸时浏览器的缩放、滚动条滚动等
var touch = evt.touches[0]; //获取第一个触点
x = Number(touch.pageX); //页面触点X坐标
//记录触点初始位置
startX = x;
}
catch (e) {
console.log('touchSatrtFunc:' + e.message);
}
}

//touchmove事件,这个事件无法获取坐标
function touchMoveFunc(evt) {
try
{
//evt.preventDefault(); //阻止触摸时浏览器的缩放、滚动条滚动等
var touch = evt.touches[0]; //获取第一个触点
x = Number(touch.pageX); //页面触点X坐标
var y = Number(touch.pageY); //页面触点Y坐标
}
catch (e) {
console.log('touchSatrtFunc:' + e.message);
}
}

//touchend事件 在触摸结束时触发事件
function touchEndFunc(evt) {
try {
//evt.preventDefault(); //阻止触摸时浏览器的缩放、滚动条滚动等
t_Carousel.z_lb(t_name.t_lb,x<startX);
t_Carousel.z_lz(t_name.t_lb,x>startX);
window.clearInterval(timeID);
timeID=setInterval(function(){t_Carousel.z_lb(t_name.t_lb,true)},4000);
}
catch (e) {
console.log('touchEndFunc:' + e.message);
}
}

//绑定事件
function bindEvent() {
document.addEventListener('touchstart', touchSatrtFunc, false);
document.addEventListener('touchmove', touchMoveFunc, false);
document.addEventListener('touchend', touchEndFunc, false);
}

//判断是否支持触摸事件
function isTouchDevice(){
console.log(navigator.appVersion);
try {
document.createEvent("TouchEvent");
bindEvent(); //绑定事件

}
catch (e) {
console.log("不支持TouchEvent事件!" + e.message);
}
}

window.onload = isTouchDevice;

var t_Carousel={
z_lb:function(t,z){
if(z){

if(i>=4){

t_name.s_slM.stop(true).animate({"margin-left":"-"+(i*sWidths)+"px"},1000);
i=1;

t_name.s_slM.animate({"margin-left":"-"+(i*sWidths)+"px"},0);
t_name.s_ul.eq(i-1).css({"transform":"scale(1.1)","background-color":"#ffffff"}).siblings().css({"transform":"scale(1)","background-color":"transparent"});
}else{
t_name.s_slM.animate({"margin-left":"-"+(i*sWidths)+"px"},1000);
t_name.s_ul.eq(i-1).css({"transform":"scale(1.1)","background-color":"#ffffff"}).siblings().css({"transform":"scale(1)","background-color":"transparent"});

}
if(true){

i==1?c=0:i==2?c=1:c=2;

}
if(i<=4){
i++
}else{
i=5;
}
}

},
z_lz:function(t,z){
if(z){
$("#sts").css("display","block");
t_name.s_ul.eq(c-1).css({"transform":"scale(1.1)","background-color":"#ffffff"}).siblings().css({"transform":"scale(1)","background-color":"transparent"});
if(c>=3){
var t=c-3;
t_name.s_slM.stop(true).animate({"margin-left":"-"+(t*sWidths)+"px"},1000);

t_name.s_slM.animate({"margin-left":"-"+(c*sWidths)+"px"},0);
}else{
t_name.s_slM.animate({"margin-left":"-"+(c*sWidths)+"px"},1000);

}

c--;
if(true){
if(c<=-1){
i=1;
}else{
c==2?i=4:c==1?i=3:i=2;}
}
if(c>1){

c=2;

}
if(c<0)
{
c=3;
}
}

}
}

function Automatic_at(){
var sWidth= t_name.s_h.width();
var sWidthTo=Number(sWidth*(5/8));

t_name.s_Sc.attr("style","width:"+sWidth+"px;overflow:hidden;");
t_name.Carousel_img.attr("style","height:"+sWidthTo+"px;width:"+sWidth+"px;min-height: 80px;");
t_name.Carousel_imgs.attr("style","height:"+sWidthTo+"px;width:"+sWidth+"px;min-height: 80px;");
t_name.s_h.attr("style","height:"+sWidthTo+"px;width:100%;min-height: 80px;");
$("#sts").attr("style","width:"+sWidth+"px;overflow:hidden; display:none;");
$(".slider-mains").attr("style","margin-left:-500px;");
}

$(window).resize(function(){
Automatic_at();
});

Automatic_at();
timeID=setInterval(function(){t_Carousel.z_lb(t_name.t_lb,true)},4000);
});

</script>

<body>
<div id="s_Shell" >
<div id="s_height" class="s_width">
<div id="Seamless_carousel" >
<div id="s_heights" style="width:4000px; overflow:hidden;" >
<ul class="slider-mains" >
<li ><img id="sts" class="s_width" src=" img/item2.jpg"/></li>
<li ><img class="s_width" src=" img/ss.png"/></li>
<li ><img class="s_width" src=" img/item1.jpg"/></li>
<li ><img class="s_width" src=" img/item2.jpg"/></li>
<li ><img class="s_width" src=" img/ss.png"/></li>
</ul>
</div>
</div>
</div>
<div id="s_us" >
<ul>
<li style="background-color:#ffffff; transform:scale(1.1);"><div ></div> </li>
<li><div ></div> </li>
<li><div ></div> </li>
</ul>
</div>

</body>
</html>

APP 半自适应 WEB页面的更多相关文章

  1. 用Chrome devTools 调试Android手机app中的web页面。

    (1) 手机要满足Android系统为4.4或更高版本,低版本不支持这种方式.(2) 确保App已经开启了webview的debug调试模式,由Android工程师协助.(2) 用usb数据线连接好手 ...

  2. iOS之safari调试iOS app web页面

    Overview 当下移动端开发过程中大量使用前段H5.js等等技术,而这些web页面的调试在Xcode控制台中不太明了,经常我们移动app运行了就是方法,但是不能显示响应的效果,这时候或许就是已经报 ...

  3. PhoneGap 白名单安全机制 navigator.app 加载外部页面返回以及退出介绍

    一. Phonegap 白名单安全机制 Phonegap应用的页面大多存在于本地,但有时需要加载外部的Web页面到应用内置的浏览器 视图中已完成特定的应用功能,出于安全性考虑,PhoneGap 设立了 ...

  4. 客户端相关知识学习(一)之混合开发,为什么要在App中使用H5页面以及应用场景、注意事项

    混合开发 随着移动互联网的高速发展,常规的开发速度已经渐渐不能满足市场需求.原生H5混合开发应运而生,目前,市场上许多主流应用都有用到混合开发,例如支付宝.美团等.下面,结合我本人的开发经验,简单谈一 ...

  5. safari 调试iPhone web页面

    safari设置-打开Safari偏好者设置,选中“高级菜单”,在页面最下方看到“在菜单中显示开发菜单”的复选框,在复选框内打钩,这样设置完毕就能在Safari菜单中看到开发菜单了 iPhone 设置 ...

  6. appium处理app与web页面的转换

      测微信页面的时候使用谷歌app,进入微信页面的链接 def setUp(self): print("set up env for android testing...") se ...

  7. phonegap(cordova)从手机app跳转到web页面在跳转回APP本地页面思路

    项目中需要用到 WAP支付宝支付. 但是 使用PHONEGAP开发 跳转到支付宝支付,然后跳转回来 就回不到APP的本地页面, 就是使用WAP的第三方登录也是一样的.很难从WAP页面在跳转到 app本 ...

  8. 【web开发 | 移动APP开发】 Web 移动开发指南(2017.01.05更新)

    版本记录 - 版本1.0 创建文章(2016.12.30) - 版本1.1 更正了hybird相关知识:增加了参考文章(2017.01.05): + Web APP更正为响应式移动站点与页面,简称响应 ...

  9. 移动端web页面如何适配

    移动端web页面如何适配,现有两个方案: 1 设置viewport进行缩放 简单粗暴,使用过程中反应缩放会导致有些页面元素会糊的情况.天猫的web app的首页使用这种方案 在页面中加入viewpor ...

随机推荐

  1. hdu 4945 2048 (dp+组合的数目)

    2048 Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submi ...

  2. net大型分布式电子商务架构

    net大型分布式电子商务架构 背景 构建具备高可用,高扩展性,高性能,能承载高并发,大流量的分布式电子商务平台,支持用户,订单,采购,物流,配送,财务等多个项目的协作,便于后续运营报表,分析,便于运维 ...

  3. Swift开发学习(两):Playground

    Swift开发学习:Playground 大约 对于软件用户.游戏玩家,我一直提倡用户体验.也是用户,是各种开发工具的使用者.也会喜欢用户体验做得好的工具软件.这次苹果想开发人员所想,提供了一个能够玩 ...

  4. (hdu step 7.1.5)Maple trees(凸包的最小半径寻找掩护轮)

    称号: Maple trees Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tot ...

  5. MEF初体验之七:Using Catalogs

    MEF特性化编程模型的价值主张之一是通过catalogs动态发现部件的能力.Catalogs允许应用程序很容易地消费那些通过[Export]已经自我注册的exports. Assembly Catal ...

  6. 揭秘上海传智播客平均工资超过7k 其中一位知情人士

    大学毕业生人数破700万大关.如何破解"毕业即失业"中国式的大学困境? 2014年全国高校毕业生总数将达到727万人,比被称为"史上最难就业年"的2013年再添 ...

  7. 记录一次有用的stackoverflow搜索

    经常逛stackoverflow有一段时间了,也遇到了不少问题 问题: 1.ckeditor中在source中输入如下代码 2.再点击source按钮,查看页面显示效果,不对啊 3.然后再检查源码,发 ...

  8. SQL开发中容易忽视的一些小地方( 三)

    原文:SQL开发中容易忽视的一些小地方( 三) 目的:这篇文章我想说说我在工作中关于in和union all 的用法. 索引定义 : 微软的SQL SERVER提供了两种索引:聚集索引(cluster ...

  9. SpringAop进行日志管理。

    在java开发中日志的管理有非常多种.我通常会使用过滤器,或者是Spring的拦截器进行日志的处理.假设是用过滤器比較简单,仅仅要对全部的.do提交进行拦截,然后获取action的提交路径就能够获取对 ...

  10. Storing and Retrieving Images from SQL Server using Microsoft .NET

    原文 Storing and Retrieving Images from SQL Server using Microsoft .NET Download source - 19.6 Kb Intr ...