-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vertical scrolling not working #31
Comments
Looks like github stripped the code from your comment... can you try resending? |
Escaped the braces... thanks! |
This is working as intended. The sliding view takes up 100% width & 100% height for the current viewport, with the intent that the content inside of the sliding view containers (sidebar and main body area) would be scrollable. In general with App-UI, anything that gets animated is clipped, rather than extending beyond the currently visibile viewport area. This is to prevent flickering/stuttering issues during animations & transitions on mobile devices. |
However, this can all be adjusted/customized in CSS. |
Hi! I'm a bit confused. Say my body panel to the right has pages and pages worth of content in it, now it won't vertical scroll at all. Take for example in your samples. 03 - SlidingView - 01 - basic.html. Now in the body div, have a large amount of content that can't fit on a single screen on an iPhone. You can't vertically scroll that content, rending the body div unusable. Is there a way you can work around that with CSS? I've tried making the overflow: scroll, but that doesn't seem to work... Mike |
Can you post a code snippet, or an example online? You should be able to to determine scrolling purely via css. I often use iScroll for mobile devices (cross platform), but if iOS only, CSS should do the trick. It could also be an issue of setting scroll policy on nested html structure. |
It's a bit tough, my code is pretty massive, but I proved it by a small edit to your sample code. Easiest way is if you take the example I referred to above from your git respository (03 - SlidingView - 01 - basic.html), go to the body div and just insert a massive amount of HTML into the content rather than just "body here!". Now open that page on your mobile and note it won't scroll vertically. If you edit the css file and change overflow:hidden to overflow:scroll in the body div, it has no effect at all. Is that helpful? I can zip and attach the modifications I made if you like. |
OK, took me a minute to figure out what was going on. I was able to recreate the issue. First, set the following styles on the "body" div: overflow:auto; The comment-out or delete line 13 in slidingview.js: This is intercepting all touch events, which prevents the browser's touch-based scrolling from working. This should get you going again, and I'll need to go back and remove that line of code in the github source tree. |
Cool, thanks! I actually found if you add the following it works better: Otherwise I was having some weird positioning issues when dragging the div back again from right to left. |
Slightly off-topic, but one thing I've found is that if you do swipe left to right, you often slightly swipe upwards or downwards and this causes the content page to scroll up or down a little bit as you swipe. Would be great to somehow prevent this as it feels a little unusual. I'm guessing the normal iOS swipe left/right gesture compensates for this and somehow prevents vertical scrolling during such a swipe. |
The easiest thing to do would be to start the swipe gesture earlier, to reduce the vertical scroll. In onTouchMove in slidingView.js, there are two if statements, that check for a value > 50. If you reduce that 50 to a smaller number, the horizontal swipe gesture would happen sooner, reducing the vertical scroll action. These two lines: Currently, the swiping doesn't actually happen until you've dragged/swipped 50 pixels. |
I'm having the same issue but with the Slidingview + ViewNavigator combo where the body is not scrollable and the solution above doesn't seem to work. I deleted the touchMove listeners from both slidingview.js and viewnavigator.js. Also, I've tried playing with the overflow settings of some of the internal classes, e.g. contentHolder, etc... All without success |
Can you post your code somewhere as a sample and I can try take a look? Mike Bartlett On Friday, 14 December 2012 at 18:11, CodeFactoryStudios wrote:
|
Can you post an example of your code? I have a sliding view + viewnavigator working here: In this example, touch scrolling works on mobile devices, but you use normal scroll wheel or touchpad on desktop computers. Source code available here: |
Thanks for the quick response Andrew. I managed to figure out what the problem was. I had my markup (a table, a UL, and some inline stuff) directly in the body div and I guess the scrolling script wasn't being able to properly calculate the height of the whole thing. I enclosed everything in a div before putting it in the body div and that did it! |
first, thanks for the fluent working sidebar/body script and thanks for the scrolling fix! |
Hi DanR1989, I also wanted to scroll the y axis in the 'body' div and had the same problem as you. slidingview.css:
|
;) |
oh, great! thank you, hsihsah :) |
When you guys are pushing the html in view put first div as a container of all the data that you are putting in it. var html ="‘ div ’ ‘ p ’ Often referred to as the “Pearle of the Antilles”, Haiti is also known to be the first country discovered by Columbus; /p /div "; then push this.. This will worked without any issue. :) |
I have the same problem, but with the ViewNavigator. I tried all workarounds suggested in this thread. No luck, unfortunately. Here is the sample code (I use handlebars as a templates system): Please advise. Thank you. |
Try removing the height:100% from the .wrapper CSS class: Change this: to: I'm pretty sure that's your issue. |
Thank you for the fast reply. I removed the height, but the issue remains :( |
As soon as I include the following line in my test page
<script src="slidingview.js"></script>
I can no longer vertical scroll the page. Is this known or is there a bug here? I've tried playing with all sorts of overflow:scroll changes, but to no avail. As soon as I comment out the above line and refresh, then I can vertical scroll just fine.
The text was updated successfully, but these errors were encountered: