Jump to content
  • Advertisement
Sign in to follow this  
gamerking

javascript need help asap

This topic is 4652 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

here is what i made how do i put a box around it?

<html>


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

<div id="news">
<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]

Share this post


Link to post
Share on other sites
Advertisement
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 javascript.

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.

Mark

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!