1

how can you scroll with scripty2??

document.body.scrollTo(300, {
    transition: 'easeInOutQuad',
    duration: 0.5
});

have also tried with window.scrollTo()

EDIT: this doesnt work either

$(document.body).scrollTo(300, {
    transition: 'easeInOutQuad',
    duration: 0.5
});

but in some other code this works fine

this.loader.morph('opacity:1; filter:aplha(opacity=100)', {
    transition: 'easeInOutQuad',
    duration: 0.5
});
clarkk
  • 27,151
  • 72
  • 200
  • 340
  • Googling `scripty2 scroll` gives me this: http://scripty2.com/doc/scripty2%20fx/element.html#scrollto-instance_method – Pekka May 08 '11 at 10:02
  • yes, I have tried that.. – clarkk May 08 '11 at 10:16
  • Show the code you have tried. – Pekka May 08 '11 at 10:21
  • Ah. You can't run scripty functions on DOM elements - you need to turn them into Scripty elements first. See below. – Pekka May 08 '11 at 10:57
  • By the way, please don't delete and re-post questions. Edit them to bump them instead. – Pekka May 08 '11 at 11:18
  • Doesn't look like it - scripty is fairly new, and I see very few questions (and answers) around. Is there a specific reason why you want to use it over jQuery? As far as I can judge, jQuery has become top dog among JavaScript frameworks. – Pekka May 08 '11 at 19:36
  • has jQuery good smooth equations to animate elements? I thought scripty2 was quite known? – clarkk May 08 '11 at 19:40
  • I'm fairly sure jQuery has what you need. See http://api.jquery.com/animate/ and http://gsgd.co.uk/sandbox/jquery/easing/ – Pekka May 08 '11 at 19:41
  • I just stumpled over scripty2's nice animation equations.. – clarkk May 08 '11 at 19:41

1 Answers1

0

document.body is not automatically a scripty element. You need to either turn it into one, IIRC like so:

$(document.body).scrollTo(.......);

or use Element.scrollTo:

Element.scrollTo(document.body, .....);
Pekka
  • 442,112
  • 142
  • 972
  • 1,088