PDA

View Full Version : Scroll stopped working with minor code change for divs.



nosarious
23 Jul 2010, 11:12 AM
I made a small change to my code so I could have a clickable button on the top of the carousel card, and a scrolling region of text underneath.
Original code:

{
title: 'Article 2',
layout: 'fit',
items: [{
scroll: 'vertical',
contentEl: 'c2'
}]
}



title: 'Article 5',

items: [{
contentEl: 'c5-title'},
{
layout: 'fit',
scroll: 'vertical',
contentEl: 'c5'
}]

The layout of this card works, but the lower part of the text no longer scrolls.

(an example is here, but is todays working copy. It opens as a web page, and you can click-swish to scroll)

Any reason why this would stop working? I am still tring to visualize how this will work, so if someone could tell me how to achieve text scrolling up to the title on each article, and text scrolling over the title in each article, that would be cool. I need to see if text over text becomes confusing to read.

meyerovb
23 Jul 2010, 11:27 AM
Try this (I didn't test it, let me know if it doesn't work)



title: 'Article 5',
layout: 'fit',
items: [{
scroll: 'vertical',
contentEl: 'c2'
}],
dockedItems:[{
dock:'top',
contentEl: 'c5-title'
}]

nosarious
23 Jul 2010, 11:42 AM
nope. good idea, though. the only thing that really changed was the text would not 'end' along the bottom edge of the title box. It would end at the edge of the padding around the title box. I'm sure I could fix that.

Your suggestion is on the first two articles in the example right now, should you care to have a glance.

meyerovb
23 Jul 2010, 11:48 AM
What articles are you referring to?

You should stick with my layout to fix the text overrun issue.

I think the paging issue is that when you turn scroll on it overrides the touchmove event and therefor stops the event from bubbling. Does the carousel work if you do a swipe directly on the dot icons? Maybe handle the touchmove or scroll events in your card manually and in your handler do a carousel change if you determine it is a horizontal instead of a vertical swipe...

nosarious
23 Jul 2010, 12:09 PM
Man, I feel silly... I forgot the link.

http://www.straathof.acadnet.ca/eleven/

Your suggestion is on the first two articles, my problem is on the last two articles, and the original behaviour before changes is at:
http://www.straathof.acadnet.ca/ten/

I have turned the dots off for the carousel. It's the text fields which stopped scrolling. (You can click-drag when visiting from a web browser)