What I'm looking for is to have the first item scroll onto the screen after the last item has scrolled off - rather than the current behavior of popping onto the screen. (I'd suggest offering a "continuous" checkbox on the UI.)
I tried faking this with an offset equal to the width of the ticker, but the last item gets blown away by the first one as soon as it gets to the center of the ticker. (I'd be happy to hear a workaround.)
Other than that, it worked as advertised right out of the box - well done.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | ticketyboo1.3_continuous_scroll.patch | 1.12 KB | giorgosk |
| #3 | ticketyboo_Continuous_scrolling.txt | 1.21 KB | meltingIce |
Comments
Comment #1
asak commented+1 for this feature
Comment #2
meltingIce commentedI'm a css and Drupal newbee but to suite my own need of a continous ticker I edited ticketyboo.module to simply duplicate nodes.
That way I get a continous scroll where last item is _immediately_ followed by first item.
While not exactly what you asked for, the method could possibly me modified by inserting empty tickers instead of duplicated ones.
Change 'dupCount' as needed, value depending on ticker size and space available.
$ diff -u ticketyboo.module.orig ticketyboo.module
--- ticketyboo.module.orig 2009-06-24 12:09:00.000000000 +0200
+++ ticketyboo.module 2009-06-27 08:52:21.000000000 +0200
@@ -220,12 +220,26 @@
$i++;
}
+ // continuous ticker by duplication of nodes
+ $dupCount = 4;
+ $count = $i;
+ if (($dupCount > 0) && ($count > 0)) {
+ for ($j = 0; $j < $dupCount; $j++) {
+ $node = node_load(trim($nodes[($j % $count)]));
+ $ret .= '
';
+ $ret .= '
+ $ret .= $node->teaser;
+ $ret .= '
';
+ $i++;
+ }
+ }
+
// build a wrapper for the contents
if ($direction == 'horizontal') {
- $w = count($nodes) * ($item_width + $item_spacing);
+ $w = ($dupCount + count($nodes)) * ($item_width + $item_spacing);
$h = $item_height;
} else {
- $h = count($nodes) * ($item_height + $item_spacing);
+ $h = ($dupCount + count($nodes)) * ($item_height + $item_spacing);
$w = $item_width;
}
$wrap_style = "width: {$w}px; height: {$h}px;";
Comment #3
meltingIce commentedoops. The diff above does not show correctly - empty quotes where div tags occur.
Uploading diff file instead.
Comment #4
dalehgeist commentedThanks, Ice. Haven't tried it yet, as the client seems fine with the non-scrolling version, but it's good to know it's there. Here's a little something in return: you can use a
<code>tag to enclose code on this board, and it will show up just like you want it.Comment #5
giorgoskmeltingIce
what does dupCount mean ? I can't figure it out
another approach would be to implement this javascript
take the first element and put it to the end of the wrapper with something like this
when the ticket has passed
but can't seem to get it to work correctly
Comment #6
giorgoskstill not sure of the implecations of dupCount
hope meltingIce can clarify it
I am using dupCount = 1 and it seems to work as expected ...
otherwise is exactly what meltingIce has implemented
please apply against 1.3 version and report back
Comment #7
giorgoskneeds review
Comment #8
avpadernoI am closing this issue, as Drupal 6 is now not supported.