[欣赏代码片段] (JavaScript) Responsive jQuery
2013-07-12 12:22
246 查看
jQuery(document).ready(function($) { /* getting viewport width*/ var responsive_viewport = $(window).width(); /* if is below 481px */ if(responsive_viewport < 481) { } /* end smallest screen*/ /* if is larger than 481px */ if (responsive_viewport > 481) { } /* end larger than 481px */ /* if is above or equal to 768px */ if (responsive_viewport >= 768) { } /* off the bat large screen actions */ if (responsive_viewport > 1030) { } // add all your scripts here }); /* end of as page load scripts */
使用Responsive jQuery在JavaScript层面上,能够很好的改善用户在不同设备(Desktop, Tablet, Mobile)上的用户体验,值得拥有!
相关文章推荐
- [欣赏代码片段] (JavaScript) 你使用过getComputedStyle没有
- 【代码片段】 javascript五秒返回主页
- 精心收集的 48 个 JavaScript 代码片段,仅需 30 秒就可理解
- 48 个 JavaScript 代码片段,仅需 30 秒就可理解
- 常用 jquery 代码片段 和 javascript 代码片段
- JavaScript 有用的代码片段和 trick
- JavaScript核心编程(代码片段)
- JavaScript和JQuery实用代码片段(一)
- 实用代码片段--Javascript
- Javascript 代码片段 - How to Clear the upload value
- JavaScript实用功能代码片段整理二
- JavaScript代码片段
- JavaScript常用的代码片段
- Javascript实用代码片段(译)
- 实用Javascript代码片段
- 5个有趣的 JavaScript 代码片段
- 超实用的 JavaScript 日期代码片段
- [代码片段]javascript检查图片大小和格式
- 100个直接可以拿来用的JavaScript实用功能代码片段
- Atom编辑器折腾记_(15)JS代码片段补全(插件:javascript-snippets)