I'm wondering is it's possible to use a rel attribute as an anchor link. For instance, the html would read as follows:
<a href="http://www.example.com/portfolio" rel="#portfolio">Portfolio</a>
<div id="portfolio">Content goes here></div>
When the link is clicked, instead of taking the user to the page, the current page will scroll to the content.
The idea is to have all or most site content on the home page and use the navigation at the top to link to the content down below. However, if javascript is not enabled, the user will be taken to the appropriate page.
Additionally, I'm using the code in this fiddle (http://jsfiddle.net/5z3NH/1/) to activate smooth scrolling. I'd like to adapt it to suit the situation I described above.
Thanks in advance!
[Edit]
I've updated my Fiddle to try a method Jukka suggested, that is, extracting the path from the href url and scrolling to a matching div down the page. It's not working yet, in that I end up linking to the URL, but maybe I can get a few more pointers.
You could try this.
JS enabled
JS disabled
Or universal solution like you tried in your fiddle
Your FIDDLE updated.