PDA

View Full Version : How was this scroll technique created?




macaddict23
Jun 24, 2008, 03:11 PM
Visit http://www.clematis.org/learn/faqs

If you click on any of the FAQ on the right column, the page scrolls down to the answer. Also, notice how the question flashes briefly with a yellow background? Nice. Any clues?



hobbbz
Jun 24, 2008, 03:13 PM
Looks like he did it using +U

macaddict23
Jun 24, 2008, 03:19 PM
Using what now? Sorry.

hobbbz
Jun 24, 2008, 03:23 PM
It was a joke but you can't read sarcasm on the internet. +U shows the source of a page. using that you can find out what code he used to achieve the effect.

macaddict23
Jun 24, 2008, 03:28 PM
That's if you're using Firefox. With Safari, it's Option + :apple: + U

;-)

dejo
Jun 24, 2008, 03:43 PM
For the scrolling, simply done using the <a> link in conjunction with the <a> anchor.
<a href="#here">

<a name="here" id="here">

Sdashiki
Jun 24, 2008, 04:14 PM
For the scrolling, simply done using the <a> link in conjunction with the <a> anchor.
<a href="#here">

<a name="here" id="here">

i doubt thats all seeing as how:

<script src="/javascripts/application.js?1178851279" type="text/javascript"></script>
<script src="/javascripts/prototype.js?1178851279" type="text/javascript"></script>
<script src="/javascripts/scriptaculous.js?1178851279" type="text/javascript"></script>

is in the head


and


<a href="#" onclick="new Effect.ScrollTo(&quot;wrapper&quot;,{});; return false;">

is within the code.

glad to see people in the topic practicing what they preach :rolleyes:

its an anchor link with obvious javascript effects.

angelwatt
Jun 24, 2008, 04:18 PM
If you check the top of the source code, the page links to the JavaScript frameworks Prototype and Scriptaculous. Not sure which specifically he used for the effect, but it's a pretty easy to do thing. I agree it's a nice effect though, might create my own for my site.

One downfall of the technique (as implemented) is that it breaks when the visitor has JavaScript disabled. It's an easy fix though is he used proper anchors. People all too often forget to code for accessibility.

Edit: I followed my own advice and wrote my own script (Gentle Anchors) for this behavior, it can be seen here (http://www.angelwatt.com/coding/gentle_anchors.php) for those interested.