Hi
I'm trying to get the rotator to automatically advance after a postback to the viewport items where the item was clicked. For the most part, it's working well, but I'm trying to set the scroll duration to zero, so it jumps to the correct viewport, then back to 500 milliseconds so that it scrolls normally. I've set the OnItemShown event, and my javascript is:
What happens is the rotator jumps to the correct location, but if sender.showNext is called (e.g. I've jumped one or more sets of items), the scrolling animation goes away. When I inspect the scrollDuration property, it's still set to 500 milliseconds, but scrolling is instantaneous, not animated.
Any ideas?
Thanks!
Mike
I'm trying to get the rotator to automatically advance after a postback to the viewport items where the item was clicked. For the most part, it's working well, but I'm trying to set the scroll duration to zero, so it jumps to the correct viewport, then back to 500 milliseconds so that it scrolls normally. I've set the OnItemShown event, and my javascript is:
// Set up the scroll position |
var currentIndex = <%= this.CurrentIndex %>; |
var isFirstLoad = true; |
function OnItemShown(sender, arg) { |
if (isFirstLoad == true) { // First loading |
isFirstLoad = false; |
sender.set_scrollDuration(0); |
// now scroll until currentIndex is reached |
for (var i = 0; i < currentIndex; i++) |
{ |
sender.showNext(Telerik.Web.UI.RotatorScrollDirection.Up); |
} |
sender.set_scrollDuration(500); |
} |
} |
What happens is the rotator jumps to the correct location, but if sender.showNext is called (e.g. I've jumped one or more sets of items), the scrolling animation goes away. When I inspect the scrollDuration property, it's still set to 500 milliseconds, but scrolling is instantaneous, not animated.
Any ideas?
Thanks!
Mike