Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

anchor point when you have a scroll page...

Status
Not open for further replies.

jdubz

Technical User
Apr 28, 2002
70
okay, here's one for ya, i am doing a site and the client wants no scroll bars on the page, so on pages with more info to fit the window, i have put scroll arrows. now on a page that has a ton of copy, they want an index at the top of the page and have anchor points to the sections. problem, is, it won't scroll the internal page. this is the page in progress...


any ideas would be amazing. actually make that any ideas that solve the problem would be amazing.
thanks,
jw
 
jdubz, why not use iFrames instead of using the <div container>, using <iFrames> is like having mini-windows on the page, and you can use the anchor tags on them, with no scroll bars and whatnot.

Only one issue, iFrames only work on IE5+ and NS6+, and not on NS4 browsers

A typical iFrame code looks like:
<iframe src=&quot;nameofpage.html&quot; height=&quot;100%&quot; width=&quot;100%&quot; name=&quot;nameofiframe&quot; bottomscroll=&quot;no&quot; frameborder=&quot;0&quot; bgcolor=&quot;&quot;></iframe>


So just place this iFrame code on your HTML page, reference all your <a> tags to this iFrame, like :
Code:
<a href=&quot;page2.html&quot; target=&quot;nameofiframe&quot;>somepage</a>

Reality continues to ruin my life...
 
that's definetly an option, i guess, i stopped thinking about using frames since i started this dw stuff when IE4 was still kicking around and everyone was alwasy chanting &quot;NO FRAMES&quot;
speaking of which, what in your best approximation would be the amount of people still using the IE4 and earlier NS6 as browsers?

thanks,
jw
 
jdubz, iFrames are kind of different then the traditional frames. iFrames are more flexible and involve less coding.

This site gives an assumption on the current browser stats: but like all other stats report, it can be misleading. In all honesty, I say leave NS4 alone, rarely anyone uses that old of a browser anymore. But luckily, there is an alternate method of the iFrames in NS4, you can use iLayers, which work the same way as iFrames, but geared towards NS4 browsers. Only one issue with iLayers, they do not use the scroller attribute that iFrames uses. In other words, in iFrames if the page is long, you can have scrollbars appear, whereas in iLayers it just fits to the content of the iLayer.

You can do a search for iFrames and iLayer in google for some example and whatnot. But if you want my opinion, code for IE4+ and NS6+ only, leave Ns4 alone, too much hassle to try to include the 1% of users that use NS4

Hope this was helpful...

Reality continues to ruin my life...
 
anchors:
Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
&quot;[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd&quot;>[/URL]
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body>
<p><a href=&quot;#my_anchor&quot;>goto</a>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a name=&quot;my_anchor&quot;></a>my anchor is here </p>
</body>
</html>
...if the anchors is the goal...
All the best!


> need more info?
:: don't click HERE ::
 
hey lebisol,
will this work for the kind of scroll i'm doing on the page listed above? by pitiing in the <p> </p> in the code push the scroll up with in the layer?
thanks in advance...
 
it will work for the entire page......within the layer or not....it will not make the layer &quot;scroll&quot; but it will move to that point....as u have to for &quot;formatting&quot; link.
If ur using frames or Iframes then u have to also remember to include the target frame name
Code:
<a href=&quot;pageName.html#anchor&quot; target=&quot;_myFrame&quot;>goto</a>
u can also use
Code:
<a href=&quot;javascript:window.scrollTo(0,0);&quot;>Back to top of page</a>
where u can specify x,y coordinates vs. anchors points.
All the best!

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top