Coder Social home page Coder Social logo

zhansingsong / orientationchange-fix Goto Github PK

View Code? Open in Web Editor NEW
71.0 71.0 19.0 12 KB

基于@media特性实现对原生orientationchange的修复 ( orientationchange-fix is a based on @media attribute to fix orientationchange utility library, orientaionchange polyfill.)

JavaScript 100.00%
css3 orientaionchange-polyfill orientationchange

orientationchange-fix's Introduction

Hi there 👋 I'm singsong 😝

一枚前端开发,也了解点后端,喜欢 TypeScript, 工程化, 可视化, 代码规范, DevOps。

一些有趣的项目 🎨

orientationchange-fix's People

Contributors

zhansingsong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

orientationchange-fix's Issues

屏幕旋转时候获得的可用高度值经常不一样

添加了你的fix代码之后,发现屏幕旋转时候获得的可用高度值经常不一样(多测几次就会发现)。
`<!doctype html>

<title>test</title>

<script src="js/jquery-2.1.1.min.js"></script> <script src="js/orientationchange-fix.js"></script> <script> var f=function(){ $("p").html($(window).innerHeight()); } f(); window.addEventListener("orientationchange",f,false); </script> `

目前我的解决办法是使用原生的orientationchange事件,然后延迟300毫秒执行事件处理函数。
`<!doctype html>

<title>test</title>

<script src="js/jquery-2.1.1.min.js"></script> <script> var f=function(){ setTimeout(function(){ $("p").html($(window).innerHeight()); },300); } f(); window.addEventListener("orientationchange",f,false); </script> `

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.