Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

scrollview - new option - innerHeight #1345

Closed
mattsahr opened this issue Apr 1, 2011 · 1 comment
Closed

scrollview - new option - innerHeight #1345

mattsahr opened this issue Apr 1, 2011 · 1 comment

Comments

@mattsahr
Copy link

mattsahr commented Apr 1, 2011

When using jQueryMobile's scrollview, instead of requiring the HTML markup to include a <div class="view">, and requiring a CSS or style declaration to get its height correct, scrollview could include another option, for example...

<div data-scroll="y" data-scroll-innerheight="500">...</div>

which could parse in scrollview.js to:

var innerHeight = $this.jqmData("scroll-innerheight");
if (innerHeight)
    opts.innerHeight = innerHeight;

Then in jquery.mobile.scrollview.js, when we call a new scrollview, you could add a bit to the _create function after $child has been created, to say...

if (options.innerHeight)
    $child.css('height', options.innerHeight);

It seems like the inner height would be friendlier if it could be reduced to an option, but users could go either way. Declare the "data-scroll-innerheight" to automate it, or leave it out and define your own class="view" styles.

Obviously, this could also be used for an innerWidth option.

I have been using scrollview a LOT, and I think it's great. Thanks for the amazing work.

@ghost ghost assigned jblas Apr 12, 2011
@toddparker
Copy link
Contributor

Added to the feature request wiki:
https://github.com/jquery/jquery-mobile/wiki/Feature-Requests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants