js浮动层的控制
2015-11-02 16:36
513 查看
(function () { var resizeContentWrapper = function () { console.group('resizing'); var target = { content: $('#resizeme') }; //resize target content to window size, assuming that last time around it was set to document height, and might be pushing document height beyond window after resize //TODO: for performance, insert flags to only do this if the window is shrinking, and the div has already been resized target.content.css('height', $(window).height()); var height = { document: $(document).height(), window: $(window).height() }; console.log('height: ', height); if (height.document > height.window) { // Scrolling needed, no need to externd the sidebar target.content.css('height', ''); console.info('custom height removed'); } else { // Set the new content height height['content'] = height.window; target.content.css('height', height['content']); console.log('new height: ', height); } console.groupEnd(); } resizeContentWrapper(); $(window).bind('resize orientationchange', resizeContentWrapper); })(jQuery);
相关文章推荐
- js 无缝滚屏
- 实用JS收录(持续更新)
- 时间戳 以及 tojson
- 五大浏览器js 判断IE、Firefox、Safari、Chrome、Opera
- JavaScript基础学习(一)--对象实例String的学习
- 在同一个jsp页面包括嵌套页面出现2个相同的id会怎么样
- JS预先加载图片
- 百度API返回JSON数据解析
- javascript+css相册
- JS代码
- web应用下jsp中img src访问绝对路径的解决办法
- selenium使用js代码验证数据正确性
- 使用JspSmart文件上传
- js正则小记
- js json 转化
- 关于去除Eclipse对JavaScript的验证
- JavaScript中Java式的类的继承
- jsp引入js文件的疑惑
- Extjs的完成按钮和位置
- javascript注册表单验证实现