View Full Version : Bookmark script for lengthy pages

08-09-2005, 05:08 AM
Hi, I'm making a website that has many pages that are very lengthy and I was wondering if there is any sort of script to sort of bookmark where you are in a page using cookies in case the visitors to the site want to take a break from reading and come back at another point and continue where they left off.

I've seen scripts where you can click a link to zoom down to another spot in the page, and I've seen scripts that puts an object in the lower or upper corner of a page so that it stays there even when you scroll, I was hoping for something like that... The user can read away and click a "Bookmark" button on that object if they need to take a break from reading.

Thanks so much for any help anyone can give me!

08-09-2005, 09:49 AM
You didn't provide a link so I'm guessing here, but it sounds like a better idea to divide up those lengthy pages into an suitable number of shorter ones.
Although for certain purposes like references and manuals, pages longer than average (two to three times the window height) are acceptable, they shouldn't get so long that visitors lose their orientation on them.
Better cut them up into more managable size pages and provide a sort of index to easily navigate through them.
Visitors are likely to remember which page they were visiting last if each is titled clearly, and the smaller size should pose no real problems in finding back the point where they left off by scrolling up and down a bit.

A usable example of articles divided up as described can be found on Webmonkey, like this one on Ruby on Rails (http://webmonkey.wired.com/webmonkey/05/28/index4a.html?tw=backend).

08-09-2005, 09:50 AM
As a web design tips goes as, a web page shouldn't be lengthy and should be sub divided into parts or sections according to the content. If it was lengthy, then visitors will lose their ways in reading down the page, causing desire to unwilling to go on.

In addition, the bookmarks script only works in MSIE with just clicking, and in other browsers , you need to press Ctrl+D or their assign bookmarker key.

Download it here :


08-09-2005, 11:05 AM
You could do something with cookies, and, uhhh, what was it again, body.offsetheight to determine the scrollbar?

08-09-2005, 08:25 PM
Well, the visitors *want* them to be lengthy. They are stories and fanfics submitted by the visitors. They have the option of downloading the story as either a text file (which I prefer for this reason, when reading long text files I type "=-=" as my "bookmark" then later go to Edit->Find... and search for "=-=" and boom, I'm there. They're also sometimes available in MS Word if there is formatting that would make it more suitable for that. But, some people want to view it as a long HTML file so that they don't have to download anything. I could chop these files up into multiple html files, especially since many have chapters, but that would make it a heck of a lot more hassle for me because as it is now, I handle thousands of files to upload (and one at a time because of my host, and I must use it because it has no maximum bandwidth transfer) But if I chopped it like that, then it would be a matter millions of files.

As for this "body.offsetheight to determine the scrollbar", could you expand or give a link to show how to use that stuff? I don't know much about andvanced coding to do stuff like this, and don't even know what that is referring to.

08-21-2005, 08:41 AM
<title>Fun Scroll</title>
<style type="text/css">
<script type="text/javascript">
window.onload = function(){
var strCook = document.cookie;
var intS = strCook.indexOf("!~");
var intE = strCook.indexOf("~!");
var strPos = strCook.substring(intS+2,intE);
document.getElementById("divTest").scrollTop = strPos;
function SetDivPosition(){
var intY = document.getElementById("divTest").scrollTop;
document.title = intY;
document.cookie = "yPos=!~" + intY + "~!";
<div id="divTest" onscroll="SetDivPosition()">

Is this works ?