2-finger scrollable div on iPhone?

I have a UIWebView built into my iPhone app and I would like to permanently store the locked DIV header and footer on a page with a scrollable DIV center.

I know I can do this using the header / footer, which are UIView elements, but I want the header and footer to be an HTML div, as a pure HTML / JS / CSS solution will be easier to port to Android / PalmPre / AdobeAir which will be on my task list soon.

I can do this using the techniques mentioned here:

http://defunc.com/blog/?p=94

But this requires the user to use 2 fingers to scroll through the div, which is unsatisfactory for me ...

Any suggestions on how to do this?

Thanks,

Brad

+3
source share
7 answers

I found a person who implemented a reusable solution for this with a header and footer:

http://cubiq.org/iscroll-4

+6
source

I'm not too familiar with UIWebView, so this can be an absolutely stupid suggestion. But is there anything preventing you from having three UIWebViews per page? One for the header, one for the body and one for the footer. Because breaking it sounds like the right idea.

+2
source

, ? iPhone .

index.html div "header", "container" "footer" , fixed.js. , "touchmove":

    // Disable flick events
    disableScrollOnBody : function() {
        document.body.addEventListener("touchmove", function(e) {
            e.preventDefault();
        }, false);
    },

"touchstart", "touchmove" "touchhend", div "content" "". "content" div .

100% HTML/CSS/JavaScript, CSS JavaScript WebKit, . , .

, . "Doctyper" Herrara Mobile Safari.

+2

, div, . , div . (-) .

iPhone/touch, , , .

+1

CSS CSS Safari, , , . -, "-webkit" "-khtml", , WebKit, 3D . Android.

JavaScript - WebKit WebKit API DOM . javascript , .

0

iScroll iphone, , , . , (1.6) , , javascript, .

0
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<div style="overflow: scroll">

HTML-, .

0

Source: https://habr.com/ru/post/1704283/


All Articles