<script type="text/javascript"> $(function(){ // 获取终端的相关信息 var Terminal = { // 辨别移动终端类型 platform : function(){ var u = navigator.userAgent, app = navigator.appVersion; return { // android终端或者uc浏览器 android: u.indexOf( || u.indexOf(, // 是否为i…
前言 惯例~惯例~昨天发表的使用OWIN作为WebAPI的宿主..嗯..有很多人问..是不是缺少了什么 - - 好吧,如果你要把OWIN寄宿在其他的地方...代码如下: namespace ConsoleTest { class Program { static void Main(string[] args) { string baseAddress = "http://localhost:9000/"; // 管道地址 //开启管道监听 WebApp.Start<Startu…
外贸建站之图片预加载JS代码分享 function preloadimg() { setTimeout(function() { new Image().src = "images/201708/source_img/6590_G_1502767440205.jpg"; new Image().src = ("images/201708/goods_img/6590_P_1502767440094.jpg"); new Image().src = ("im…
转至:http://blog.sina.com.cn/s/blog_c342e3090102vcxu.html 1.手机端的图片选择和预览 <input type="file" id="preview"/><img id="theImg"/> var oBtn = document.getElementByIdx_x_x('preview');    var oImg = document.getElementByIdx_…
最近在弄微信端的公众号.订阅号的相关功能,发现原本网页上用的uploadify图片上传功能到手机端有的手机类型上就不能用了,比如iphone,至于为啥我想应该不用多说了吧(uploadify使用flash实现上传的): 经过研究找到了一个手机端比较相对比较好用的插件实现图片上传,那就是megapix-image插件,比uploadify还是好用多了,下面就来上实例吧: html页面: <html> <body> <input type="file" cap…
输入相同域名,在pc端和移动端会出现不同的页面效果,一种是用栅格系统实现自适应, 更多的是设计两套不同的模板和两个二级域名或者一个主域名和一个二级域名(就是有区别就可以了); js代码判断浏览器的用户代理头类别从而实现不同跳转 <script type="text/javascript"> (function(){ var ua = window.navigator.userAgent.toLowerCase(); if (!(/Android|webOS|iPhone|i…
<script type="text/javascript"> var mobileAgent = new Array("iphone", "ipod", "ipad", "android", "mobile", "blackberry", "webos", "incognito", "webmate&qu…
html代码 <div class="demo" id="demo" style="overflow:hidden; width:660px; height:185px;" onmousemove="fnMouseOver();" onmouseout="fnMouseOut()"> <table border="0" align="center"…
<img id='banner1' src="images/banner.jpg" usemap="#banner" border="0"/><map name="banner" > <area id='111' shape="rect" coords="x1,y1,x2,y2" href="/swt/"></map>…
1 $("img").click(function(){ //获取窗口可视大小 var width=$(window).width(); var height=$(window).height(); var img=$(this); var html=''; $("<img/>").attr("src", $(img).attr("src")).load(function() { realWidth = this.…