Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 01-25-2005, 12:53 AM link scroll
log2's Avatar
Skilled Talker

Posts: 80
Trades: 0
I have a quick question, Is there a way to make a link scroll as you scroll down or up a page, Like, if i have a link to another site located at the top of my page, how can i make it scroll down the page when the viewer is scrolling?
log2 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-25-2005, 01:36 AM hi
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
You will have to use it in a menu.

Copy this right at the end, above the </BODY> tag.

Code:
 
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft"> 
<!--EDIT BELOW CODE TO YOUR OWN MENU-->

You can just put a link in here, or you could have a whole range of things.

<!--END OF EDIT-->
</layer>

<script type="text/javascript">
//Enter "frombottom" or "fromtop"
var verticalpos="frombottom"
if (!document.layers)
document.write('</div>')
function JSFX_FloatTopDiv()
{
 var startX = 3,
 startY = 150;
 var ns = (navigator.appName.indexOf("Netscape") != -1);
 var d = document;
 function ml(id)
 {
  var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
  if(d.layers)el.style=el;
  el.sP=function(x,y){this.style.left=x;this.style.top=y;};
  el.x = startX;
  if (verticalpos=="fromtop")
  el.y = startY;
  else{
  el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
  el.y -= startY;
  }
  return el;
 }
 window.stayTopLeft=function()
 {
  if (verticalpos=="fromtop"){
  var pY = ns ? pageYOffset : document.body.scrollTop;
  ftlObj.y += (pY + startY - ftlObj.y)/8;
  }
  else{
  var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
  ftlObj.y += (pY - startY - ftlObj.y)/8;
  }
  ftlObj.sP(ftlObj.x, ftlObj.y);
  setTimeout("stayTopLeft()", 10);
 }
 ftlObj = ml("divStayTopLeft");
 stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 01-25-2005, 03:49 AM
log2's Avatar
Skilled Talker

Posts: 80
Trades: 0
can i make it so when i open a new window, using js, can i make it have that at the top, if it's not my site?
log2 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to link scroll
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28995 seconds with 12 queries