English 中文(简体)
无固定高度的微量电离层动力(继续通过亚X装载)?
原标题:iOS div momentum scrolling without fixed height (content loaded via ajax)?

我正在制作一个有固定电离层的电离层仪(见200px高)和电离层中所含内容。 我不喜欢“SOS”滚动,因为它不像你通过仅仅通过一个网页上抹掉的本土滚动(SOS的本土滚动势头,而“>/code>的缺电则没有动力)。

<代码>div 我正试图培养以下素质:

  1. Set width
  2. Dynamic height (content via AJAX)

内容从外部网站上载到一个div,使用j Query AJAX,并且可以选择重载AJAX的请求。 这意味着,视装页内容数量,<代码>div<>/code>的高度将发生变化。

I can t seem to find any solutions that allow momentum scrolling in iOS where the div doesn t have a set with, and I ve tried the following:

  1. - webkit-overflow-scrolling: touch
  2. iScroll

这些问题:

  1. This was my first choice, as it s just a css tag and usually works fine. It s new though and has a lot of bugs, including a deal breaker one for my web app. If you focus on an input element, the page zooms in (even with the meta tag set to user-scalable:no) and doesn t zoom out until you type text in the text box, and then everything is off by 3px.
  2. This solution is laggy and the height needs to be fixed. Using it s refresh function is too cumbersome as it needs to be called when the AJAX request is reloaded, when the page is reloaded, if elements are hidden, etc.

TL; : 除了-webkit-overflow-scrollingiScroll外,是否还有其他解决办法可允许我利用动态高度(通过AJAX在S中连续装满)的滚动动力滚动机。

最佳回答

我目前为克服充满活力的高度问题所做的工作,是在OMM更新后确定高点。 我通过使用以下法典这样做:

document.getElementById( content ).style.height = window.innerHeight - getPosition( loading )[1] + "px";

在这种例子中,主要的DIV是内容,我比DIV称装载量是参照点,因为根据你在网络上的哪一部分对尺寸作更改动。 下面是乡镇的职能:

function getPosition(who){
var e = document.getElementById(who);
var position = {x:0,y:0};
while (e) {
    position.x += e.offsetLeft;
    position.y += e.offsetTop;
    e = e.offsetParent;
}
return [position.x , position.y];};

此外,我认为,自5.0.1起,动物群已经固定下来。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.