Framework7: One Page scroll effect

Created on 8 Jul 2014  路  15Comments  路  Source: framework7io/framework7

Hello,
thx for your useful framework. But I have a problem:
When I have only one page the user can overscroll (grey bg).
I used a jquery code to prevent. It works great but I miss this bounce effect on a single page. How can I activate this? thx and sry for my bad english 馃榿

iOS bug outdated

Most helpful comment

This works well with current Framework7 version to eliminate the bounce effect:

.views {
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

All 15 comments

Hey there. You can try to add this css rules to your css file:

.pages {
   overflow: 'auto';
   -webkit-overflow-scrolling: touch;
}
.page-content {
   margin-bottom:1px;
}

Thanks for your quick answer. My problem is that the content between navbar and tabbar is fixed when the content is smaller than the device size. When the user tries to scroll he sees the grey background. With this code:
$('body').on('touchmove', function (e) {
if (!$('.scrollable').has($(e.target)).length) e.preventDefault();
});
... I prevented this but the content is fixed and hasnt this bounce effect

That is right. This CSS fix should do its job. Try to add it and remove your touchmove listener

:-( doesn't work but thank you for your help

Work for everyone here http://www.idangero.us/framework7/forum/#!/?margin-bottom
By the way, this fix requires that you content should be wrapped with full page layout: .view > .pages > .page.

Oh, sorry, overflow: 'auto' should be without quotes : overflow:auto

And it is for iOS, don't know about Android

Yes I tested on both but doesnt work. But I dont want to interrupt you . Thx

Ok, let me know if you find suitable solution

Yes I'll do, should I close?

Just for note. Main point of this solution is to make your .page-content at least 1px larger than .page to always keep that bouncing effect which requires for scrollable content

You can see that it works on default Kitchen sink:
Before this css fix:
08 2014 23 18 03 ios
After this css fix:
08 2014 23 18 40 ios

Hey I found the mistake
1.: 'auto' to auto (you already said)
2.: .pages to .page

And all is ok
So right code is:

.page {

overflow: auto;

-webkit-overflow-scrolling: touch;

}

.page-content {

margin-bottom:1px;

}

This works well with current Framework7 version to eliminate the bounce effect:

.views {
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nimo23 picture nimo23  路  4Comments

Samnan picture Samnan  路  3Comments

ahmeddaif1 picture ahmeddaif1  路  4Comments

mesutgok picture mesutgok  路  4Comments

M4ttscx picture M4ttscx  路  4Comments