跳到主要內容

Fixed Positioning in Mobile Browsers Error

Not all the mobile platform all support fixed position. I have written a project to be mobile friendly with bootstrap 3 and make fixed navbar on scroll. I found iOS5 and after has strong support for fixed positioning but iOS4 and below simply treats elements as static and scrolls them along with the rest of the page.

Javascript Solutions for IOSenjoy it.

    //detect is iphone/ipad/iPod and safari version under 6533
    //fix navbar-fixed-bttom position
    var safari_prefix = false;
    var ua = navigator.userAgent;
    if (/iPhone|iPad|iPod/i.test(ua) && ua.lastIndexOf("Safari/") > 0) {
        var version = ua.substr(ua.lastIndexOf('Safari/') + 7, 4);
        //console.log(ua.lastIndexOf('Safari/'));
        if (version <= 6533) {
            $(".navbar-fixed-bottom").css("position", "static");
            safari_prefix = true;
        }   
    }

iOS Release / Mobile Safari Version

➼See more

留言

這個網誌中的熱門文章

Indexed Database API - Initail

As a front web developer, I could create UI faster or Optimize file to load page faster. But it hard to faster response time form server however 80-90% of the end-user response time is spent on the frontend. Nowadays we could use the Indexed Database API, or IndexedDB to reduce the request times. Less request times, less response time. What is IndexedDB ? IndexedDB is web browser standard interface for a local database of records holding simple values and hierarchical objects. IndexedDB was initially proposed by Oracle in 2009./* wiki */ What browsers would support IndexedDB ? Most browsers of hybrid devices support it exclude IE9-, Safari 7-,iOS Safari 7.1-, Opera Mini, Android Browser 4.3-./* caniuse.com */ When shall we use IndexedDB ? Save Money on web hosting Data index sort Data keyword search Keep data for period of time How to start it? //*************************************************************** //initDB //{Object}, {data: dbName, objectStore: storeName, ...

最近設計的一組icon..太有APPLE風格被打槍了

jQuery 的slideToggle太好用了

$ ( ".collapse" ) .each ( function ( index, value ) { $ ( this ) . click ( function ( evt ) { evt.preventDefault ( ) ; //prevent the default click event of the anchor tag. var target = $ ( this ) .attr ( "data-toggle" ) ; $ ( "." + target ) .slideToggle ( ) ; } ) ; } ) ; http://code-tricks.com/create-a-common-toggler-for-div-using-jquery/