Help with static links

  • 1
  • Question
  • Updated 9 years ago
  • Answered
Hello,

This is aimed at Littleus but any advice would be great.

I want to add a static link which scrolls down the page when the user does - like in the codes site.

I have read Ed's tutorial on them but this seems to be mainly for images.

What i want to do is - see the ABCDEF little anchor links here http://hexham.info/business - i want to add that, exactly looking like that but vertical down the side of the page.

Any ideas?

Lee.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes

Posted 9 years ago

  • 1
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hey Lee

I have a static link? Can you give me the page where you see this? Thanks.
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
he means like that image scroler (down the side of the page), he wants one of them but with text instead of an image.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
i dont see it now :) - it was a link which said 'back to the top' and it followed you down the page.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
correct Alex - i want text in a box if possible. It will make it super easy to navigate the page.
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
sorry... I blanked out for a bit. Now I know what you're talking about... I think!

Here's the code:
<style type="text/css">

#topbar{
position:absolute;
border: 0px solid black;
padding: 2px;
background-color: white;
width: 40px;
height: 40px;
visibility: hidden;
z-index: 100;
}

</style>

<script type="text/javascript">

/***********************************************
* Floating Top Bar script- © Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 30//set x offset of bar in pixels
var startY = 200 //set y offset of bar in pixels
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"
}

function staticbar(){
barheight=document.getElementById("topbar").offsetHeight
var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
var d = document;
function ml(id){
var el=d.getElementById(id);
if (!persistclose || persistclose && get_cookie("remainclosed")=="")
el.style.visibility="visible"
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function(){
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : iecompattest().scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("topbar");
stayTopLeft();
}

if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar
</script>

--------------
<div id="topbar"> <a style= "text-decoration: none" href="http://yolacodes.yolasite.com/tips1&q... src="resources/Littleus/tab.png" border="0"> </div>

You can replace the img src with your text link if you want.

I hope this is what you're looking for? BTW, it'll look a little off in your site builder, but it looks fine in the preview. You can change the height and width, color, etc...
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Your a star - I'll have a play with that now
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
Littleus

Is it wrong that i love you :)

check it out works great - http://hexham.info/business

I ended up going to DD.com - think the forum was causing a pasting issue.

THANKS SO MUCH.

Lee.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
PS - does anyone think it needs moving or anything else?
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
I'm glad it was what you were looking for! =)

I would try to move to it the right a bit more - not too much but just a bit. That's just me though. =)
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
I was also thinking that - but when i have my bookmaks menu open it looks to close to the page content - when i dont it looks to far away. - i'll post screen shots below.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes


Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Ahh..... I see now what you're talking about. You have to find just the right balance. I would leave it then.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
maybe 10 pix in? - i'll have a play with it - thanks again Littleus.
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
lee, on my screen its finme in full max windown but when i redice the size it overlaps the content.
Photo of UK Duke

UK Duke, Champion

  • 3321 Posts
  • 213 Reply Likes
i guess there is no perfect position - just have to please most the people most the time.
Thanks for your input.
Lee.
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
suppose, like mon my site the background can only be seen when the window is open Fully.

Alex