Hmm, finish() does not seem to have any effect. finalize() does, but
as you predicted, it jumps to the end of the Move effect. Here's a
sample of what I'm doing (please excuse the horrifically sloppy
code/markup):
<html>
<head><style>
body { font: 12pt normal helvetica,arial; } div {float:left;}
#back,#fwd {padding:0 20px 0 20px;}
</style></head>
<body>
<div id="back"><--</div>
<div id="outer" style="overflow: hidden; width: 10em; height:
1.3em;
border: 1px solid black; ">
<div id="inner" style="width: 30em; height: 1.3em;">
START the quick brown fox jumped over the lazy
dog END
</div>
</div>
<div id="fwd">--></div>
</body>
<script src="MochiKit.js" type="text/javascript"></script>
<script src="MochiKit/New.js" type="text/javascript"></script>
<script>
var m = null;
var scrollSize = getElementDimensions('outer').w -
getElementDimensions('inner').w;
function doScroll( e ) {
var scrollBy = 0;
var leftOffset = getElementPosition( 'inner', 'outer'
).x;
if ( e.target().id == 'back' ) scrollBy = -1 *
leftOffset;
else if ( e.target().id == 'fwd' ) scrollBy =
scrollSize -
leftOffset;
var options = { x:scrollBy, y:0, duration:2.0, queue:
'break' };
m = new MochiKit.Visual.Move( 'inner', options );
}
connect( 'back', 'onmouseover', doScroll );
connect( 'fwd', 'onmouseover', doScroll );
// these two calls need to short-circuit the scrolling motion:
connect( 'back', 'onmouseout', function() { m.finish(); } );
connect( 'fwd', 'onmouseout', function() { m.finish(); } );
</script>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---