解決IOS下不支援fixed的問題

2022-03-25 02:46:46 字數 3704 閱讀 8173

我們公司有乙個頁面底部用到了fixed樣式,每當彈出鍵盤的時候,ios下fixed就會走樣(據我所知android沒有該問題)。

為此之前我經過產品的同意做了簡單的處理(方法1)。

方法一:

focus的時候讓fixed塊position變為relative,這是最簡單的處理方法。

下面是我的小demo

下一步

div>

section

>

<

script

>

$(function

() ).on(

'focusout',

'input',

function

() );

}});

script

>

body

>

html

>

方法二:

position:absolute;每次滾動的時候重新算位置。

下面是我的小demo,touch的時候作了隱藏處理,input focusout和window resize的時候作了fixed位置重新計算。

下一步

div>

body

>

<

script

>

varisios =(

/iphone|ipad

/

varlikefixed

=function

() );

//重新繫結resize事件

settimeout(

function

() ,

10);}$(

function

()

function

touchend(event)

//touch的時候隱藏

document.addeventlistener(

"touchstart

", touchstart,

false

);

//滾動後重新設定fixed div的位置

window.onscroll

=likefixed;

//touch後顯示

document.addeventlistener(

"touchend

", touchend,

false

); }

//所有input blur時重新計算位置,相容chrome$('

body

').on(

'focusout',

'input

', likefixed);

});script

>

html

>

wince下不支援的類

最近需要做個ftp客戶端,查了下mfc,很高興的發現mfc有ftp的類,趕緊查相關資料,然後信心滿滿的開工了。然後。就悲劇掉了,發現cftpconnection類用不起來,很鬱悶的上網查資料,才發現ce下是不支援這個類的。以下是正文 雖然使用evc開發wince下的應用程式和使用vc開發pc上的程式...

javascirpt函式在IE下不支援的小結

isarray isarray function isarray value var arr 1,2,3,4,5 alert isarray arr ie8 及以下不支援 filter 等 陣列的一些方法 every filter foreach map some ie8 及以下不支援 解決辦法,以...

Hive的on不支援非等值連線解決,不支援or

oracle select a.b.id asb id,b.class as b class from lpx test a a left outer join lpx test b b on a.id b.id and a.class b.class 連線條件的第二個是非等值的,不能照搬上面 hi...