Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hobbbz

macrumors 6502a
Mar 8, 2005
605
4
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.
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
For the scrolling, simply done using the <a> link in conjunction with the <a> anchor.
Code:
<a href="#here">

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

Sdashiki

macrumors 68040
Aug 11, 2005
3,529
11
Behind the lens
For the scrolling, simply done using the <a> link in conjunction with the <a> anchor.
Code:
<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("wrapper",{});; 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

Moderator emeritus
Aug 16, 2005
7,852
9
USA
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 for those interested.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.