iphone手机端图片错位修正的js代码
<script type="text/javascript">
$(function(){
// 获取终端的相关信息
var Terminal = {
// 辨别移动终端类型
platform : function(){
var u = navigator.userAgent, app = navigator.appVersion; return {
// android终端或者uc浏览器
android: u.indexOf('Android') > - || u.indexOf('Linux') > -,
// 是否为iPhone或者QQHD浏览器
iPhone: u.indexOf('iPhone') > - ,
// 是否iPad
iPad: u.indexOf('iPad') > -,
// 是否是通过微信的扫一扫打开的
weChat: u.indexOf('MicroMessenger') > -, isiOS9: Boolean(u.match(/OS []_\d[_\d]* like Mac OS X/i)) };
}(),
// 辨别移动终端的语言:zh-cn、en-us、ko-kr、ja-jp...
// language : (navigator.browserLanguage || navigator.language).toLowerCase()
}
$("#showinandroidbrowser").hide();
$("#showiniosbrowser").hide();
$("#ss1").attr("src","images/xzai1-1.jpg");
$("#ss2").attr("src","images/xzai2.jpg");
$("#ss3").attr("src","images/xzai3.jpg");
$("#showiniosbrowser").css("height",jQuery(window).height());
$("#showinandroidbrowser").css("height",jQuery(window).height());
$(".swiper-container").css("height",jQuery(window).height()*/); if(Terminal.platform.android){
$("#download").attr("src","images/android.jpg");
$("#downloadurl").attr("href","http://download.chinahrt.com/app/rx_v3_2_2_20151014092004_CHINAHRT.apk");
if(Terminal.platform.weChat) {
//在浏览器中打开
$("#showinandroidbrowser").show();
$("#showiniosbrowser").hide();
}
} else if(Terminal.platform.iPhone || Terminal.platform.iPad ){
$("#downloadurl").attr("href","itms-services://action=download-manifest&url=https://m.chinahrt.com/rongxue/iphone/rxios_1.0.34.plist");
$("#download").attr("src","images/ios.png");
if(Terminal.platform.weChat){
//在safari中打开
$("#showiniosbrowser").show();
$("#showinandroidbrowser").hide();
}else{
if(Terminal.platform.isiOS9){
//iOS9的使用教程
$("#showiniosbrowser").hide();
$("#showinandroidbrowser").hide();
$(".swiper-container").show();
$("#ss1").attr("src","images/02.jpg");
$("#ss2").attr("src","images/03.jpg");
$("#ss3").attr("src","images/04.jpg");
$(".swiper-container").css("height",jQuery(window).height()); $("#ss3").click(function(){
$("#ss1").attr("src","images/xzai1-1.jpg");
$("#ss2").attr("src","images/xzai2.jpg");
$("#ss3").attr("src","images/xzai3.jpg");
mySwiper.swipeTo(,,false);
$("#ss3").unbind("click");
$("#download").show();
$(".swiper-container").css("height",jQuery(window).height()*/); });
$("#download").hide(); }
}
} }); </script>
iphone手机端图片错位修正的js代码的更多相关文章
- 使用localResizeIMG3+WebAPI实现手机端图片上传
前言 惯例~惯例~昨天发表的使用OWIN作为WebAPI的宿主..嗯..有很多人问..是不是缺少了什么 - - 好吧,如果你要把OWIN寄宿在其他的地方...代码如下: namespace Conso ...
- 外贸建站之图片预加载JS代码分享
外贸建站之图片预加载JS代码分享 function preloadimg() { setTimeout(function() { new Image().src = "images/2017 ...
- 手机端图片预览和缩放js
转至:http://blog.sina.com.cn/s/blog_c342e3090102vcxu.html 1.手机端的图片选择和预览 <input type="file" ...
- megapix-image插件 使用Canvas压缩图片上传 解决手机端图片上传功能的问题
最近在弄微信端的公众号.订阅号的相关功能,发现原本网页上用的uploadify图片上传功能到手机端有的手机类型上就不能用了,比如iphone,至于为啥我想应该不用多说了吧(uploadify使用fla ...
- 自动判断PC端、手机端跳往不同的域名JS实现代码
输入相同域名,在pc端和移动端会出现不同的页面效果,一种是用栅格系统实现自适应, 更多的是设计两套不同的模板和两个二级域名或者一个主域名和一个二级域名(就是有区别就可以了); js代码判断浏览器的用户 ...
- 【转】自动识别是手机端还是pc端只用一行代码就搞定
<script type="text/javascript"> var mobileAgent = new Array("iphone", &quo ...
- 图片左右滚动的js代码
html代码 <div class="demo" id="demo" style="overflow:hidden; width:660px; ...
- js动态改变图片热区坐标,手机端图片热区自适应
<img id='banner1' src="images/banner.jpg" usemap="#banner" border="0&quo ...
- js手机端图片弹出方法
1 $("img").click(function(){ //获取窗口可视大小 var width=$(window).width(); var height=$(window). ...
随机推荐
- Ubuntu 配置swftools(Ubuntu14.04)
1.下载文件 wget http://swftools.org/swftools-0.9.0.tar.gz .tar.gz wget http://www.ijg.org/files/jpegsrc. ...
- C语言基础学习基本数据类型-变量的输出与输入
变量的输出 变量如何输入输出呢?实际上,在这之前你已经使用过输出语句(printf语句)了,我们可以使用printf来执行输出. printf语句的使用方法如下: printf(格式控制字符串, 数据 ...
- 解决android studio 创建新项目后假死
概况:升级sdk编译api后,创建新的android项目后,在构建过程中假死:原有创建的项目 均运行正常:但是新建的项目只要build,电脑除了鼠标之外的,什么都动不了. 通过一系列的折腾,并重启了N ...
- pcduino通过sd卡刷系统
1.登录到pcduino的官网,下载相应的文件. 下载第一个kernel和后面那个ubuntu. 2.将SD卡插入到电脑上,运行下面这个软件: 那个盘符就是你的SD卡的盘符,选择卡量产,镜像文件选上面 ...
- Touch事件
http://www.cnblogs.com/shawn-xie/archive/2012/12/07/2805582.html 前言 一个触屏网站到底和传统的pc端网站有什么区别呢,交互方式的改变首 ...
- Bash 使用技巧大补贴
https://linuxtoy.org/archives/the-best-tips-and-tricks-for-bash.html
- 51单片机引脚ALE/PROG/PSEN/EA/Vpp
51单片机的4个控制引脚,其中一个引脚是复位引脚(RST/Vpd),RST是复位引脚,当RST输入端保持2个机器周期以上高电平时,就实现复位. ALE/PROG是地址锁存允许信号输出端,在读写外部存储 ...
- Linux企业级项目实践之网络爬虫(20)——扩展成为规则插件模式
为了方便我们爬虫功能的扩展,最好使用插件机制.使用插件技术能够在分析.设计.开发.项目计划.协作生产和产品扩展等很多方面带来好处:(1)结构清晰.易于理解.由于借鉴了硬件总线的结构,而且各个插件之间是 ...
- 深入浅出 消息队列 ActiveMQ
http://blog.csdn.net/jwdstef/article/details/17380471
- poj 3666 Making the Grade(dp)
Description A straight dirt road connects two fields on FJ's farm, but it changes elevation more tha ...