Click to See Complete Forum and Search --> : Scroll Bar on part of page.. and framesets


Nulrick
01-28-2003, 02:16 PM
As a JS beginner, please bare with me..

I'm looking for a script that will allow me to apply a scrollbar to a portion of my HTML page... essentially like a frameset works in that you can prevent some frames from scrolling <SCROLL=NO> while only allowing one frame to scroll.

I am going this route because when building the frameset, I realized that when the browser's "Back" button is hit, only one frame goes back, as opposed to all.

Does anyone know a script that would force the browser back button to reload ALL previous frames with one hit?

If that isn't possible then I'm looking for a script that can be set to scroll only a portion of an HTML page.


Help anybody?

Thanks!


Nicole Ulrick

Webskater
01-28-2003, 04:14 PM
I must be missing something here. When you hit the back button you go to the last page cached. It does not reload the previous page, or any frames on it. It shows you what you were just looking at. Surely the danger comes when someone uses the back button and then re-freshes the page and possibly executes a database action again. I prevent this normally by setting a global variable so that if a page has executed a database action and is then re-freshed I put a message on the page saying "you've already done this once etc."

If you want just part of a page to scroll I find the most elegant solution is to use an <iframe>.

jdavia
01-28-2003, 04:50 PM
If you want just part of a page to scroll I find the most elegant solution is to use an <iframe>.
I was going to suggest that too.

If you insist on the other way, This will take you back to the first page in a framed site. Maybe you can make some changes to it.

<A href="
javascript:if(frames.length>0){for(IizY8E7a=0;IizY8E7a<frames.length;IizY8E7a++)
{for(Jh3QtT7r=0;Jh3QtT7r<frames[IizY8E7a].history.length;Jh3QtT7r++)
{frames[IizY8E7a].history.go(-Jh3QtT7r)}}void(null)}else{alert('This window is not framed.')}">
<NOBR><FONT color="#0000ff" size="+1">Back All Frames to Beginning</FONT></NOBR></A>

This is a "bookmarklet" Check out bookmarklets.com for others that you can adopt as links.

Nulrick
01-29-2003, 10:24 AM
Thanks for the feedback!

I am looking into Iframes, but for various reasons I would love to stick with the frameset that I first tried.

Regarding the code supplied above, since I'm new at this, where exactly would I place this code?
Would it be placed in the main frameset page? or in each individual html page? Would it be in the head or the body portion? Would I need to change any portion of this code?

To clarify, I have the navigational system set up so that when a user clicks to load a certain page, two html pages are loaded each into a separate frame. Afterwards I realized that when the browser back/forward buttons are hit, only one frame is reloaded.. you would have to hit the back button again until all previous frames are reloaded..


Thanks!!!

jdavia
01-29-2003, 11:06 AM
It would seem to me that you can break away from using frames. A two column or a two row table is easier and can look like simulate what you are after.
Here are two a simple examples.

Two Columns
<table width="750" border="1" cellspacing="10" cellpadding="0"
bgcolor="#ffffff" bordercolor="#000000">
<tr>
<td align="center"width="325">
This is the Left Column
</td>
<td align="center"width="325">
This is the Right Column
</td>
</tr>
</table>

Two Rows
<table width="100%" border="1" cellspacing="10" cellpadding="0"
bgcolor="#ffffff" bordercolor="#000000">
<tr>
<td align="center">
This is the Top Row
</td>
</tr>
<tr>
<td align="center">
This is the Bottom Row
</td>
</tr>
</table>