Skip to main content
gamedev.net
🔒 Locked

javascript need help asap

Started by gamerking Sep 24, 2005 at 3:25 AM 0 replies 650+ views
Original Post
gamerking
gamerking
here is what i made how do i put a box around it?


<html>


<body onload="scrollNews('news', 0);">

<h1>This is the latest news</h1> hi <style type="text/css"> #news { position: absolute; visibility: visible; z-index: 10; top: 45px; left: 650px; height: 75px; width: 250px; clip: rect(0px, 100px, 60px, 0px); border-width: 0px; padding-top: 40px; } </style> <script language="JavaScript"> function getObject( obj ) { var strObj if ( document.all ) { strObj = document.all.item( obj ); } else if ( document.getElementById ) { strObj = document.getElementById( obj ); } return strObj; } var theTop = 20; var theHeight = 100; var theWidth = 150; var theLeft = 650; var toClip = 55; function scrollNews( newsDiv, toMove ) { theDiv = getObject( newsDiv.toString() ); if ( theDiv == null ) { return; } if ( document.layers ) { theDiv.clip.top = toMove; theDiv.clip.bottom = toMove + toClip; theDiv.top = theTop - toMove; } else { theDiv = theDiv.style; theDiv.clip = "rect(" + toMove + "px " + (theWidth + theLeft) + "px " + (toMove + toClip) + "px 0px)"; theDiv.top = theTop - toMove + 'px'; } if ( ( theTop + theHeight - toMove ) < ( theTop - theHeight - 20 ) ) { toMove = 0; if ( document.layers ) { theDiv.clip.top = theTop; theDiv.clip.bottom = toClip; theDiv.top = theTop } else { theDiv.clip = "rect(" + toMove + "px " + (theWidth + theLeft) + "px " + (toMove + toClip) + "px 0px)"; theDiv.top = theTop + 'px'; } } toMove = (toMove + 1); setTimeout("scrollNews('" + newsDiv + "'," + toMove + ")", 100); } </script> </html>
[Edited by - gamerking on September 24, 2005 3:46:29 AM]
Matt : mattb0001@hotmail.comClick me please
markr
markr
Your HTML has been mangled by Gamedev.net. Please either put it in source tags, or paste it into a paste site and supply the link.

Sounds like you want an iframe, not using &#106avascript.<br/><br/>I really hate those little pseudo-windows that web sites use - they're so unusable. My biggest gripe is that the scrolly wheel on my mouse never works with them. IFrames are a definite win.<br/><br/>Mark

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.