Divs not scrolling



  • I've noticed that it's not possible to make content inside a DIV element scrollable. Setting a fixed height and defining overflow auto or scroll produces something that looks like a scroll bar track but you are not able to scroll the content in the DIV.

    Any chance of this being fixed in the next version? Any idea when an update for the QtWRT environment might be coming?



  • bq. Any chance of this being fixed in the next version? Any idea when an update for the QtWRT environment might be coming?

    I don't think so. The API to do that is missing from QtWebKit, and nobody implemented that for the next version (QtWebKit 2.1).

    I don't know your particular design but it is generally a bad idea to have div with overflow on mobile device. You don't have enough screen space to have multiple scrolling area. Moreover, the experience of nested scrolling is terrible with touch screen interface.

    If you just want one area, you should use the main frame for scrolling. This does not have scrolling issue, and gives better performance than blocks with overflow.



  • A pity it won't be fixed. Would have been really usefull in this case.

    Thanks for the reply!



  • I agree that you shouldn't have nested scrolling in UI but the use-case could be e.g. to show two columns where you could have news items list in the left and actual article on the right. It would be nice to be able to scroll the news items as well as the long article separately.

    Currently you can achieve this by implementing the second column with iframe. It would be great if we could have the same functionality with scrollable DIVs at some point.

    I recorded a short video clip of the iframe implementation in action:
    "http://www.youtube.com/watch?v=yC8Q4P2QHg8":http://www.youtube.com/watch?v=yC8Q4P2QHg8



  • bq. Currently you can achieve this by implementing the second column with iframe. It would be great if we could have the same functionality with scrollable DIVs at some point.

    I think it will come at one point, but I don't think it can be in the next version.

    Note that using iframe can be significantly faster than div with overflow (except if the iframe's background is no opaque).
    With HTML 5's messages, iframes are not as painful as before.



  • Might have to go with an iFrame then. And for the record - I wasn't planning to use it as nested scroller - more like a 'popup' with an overlay. Handy for extended alert messages etc. Iframe seems to be the way - even though I really hate using frames of any kind in HTML.

    Thanks Tommi for that video demo!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.