hustla21519
06-02-2003, 08:00 PM
yeah.... i know, im supposed to search javascriptkit.com. well i did, thats where the problem comes in. i got the code for statically placing objects, and im trying to use the "spinmenu.js" but the three codes dont seem to be collaborating. ive been working on this since 6:00pm central time yesterday, and i needed it then too. ive tried all the variables that my mouse could muster. could somebody point me in the right direction?
heres the code im "trying" to use:
dosc:
<script language="JavaScript1.2">
document.write("Your browser\'s dimensions are: ")
//if browser supports window.innerWidth
if (window.innerWidth)
document.write(window.innerWidth+" by "+window.innerHeight)
//else if browser supports document.all (IE 4+)
else if (document.all)
document.write(document.body.clientWidth+" by "+document.body.clientHeight)
</script>
variables for banner:
<div id="staticbanner" style="position:absolute;">
Advertisement<br>
<a href="http://test.htm"><img
src="test.gif" width="120" height="90" alt="Click here!"
border="0"></a>
</div>
<script>
//define universal reference to "staticbanner"
var crossobj=document.all? document.all.staticbanner : document.getElementById? document.getElementById("staticbanner") : document.staticbanner
function positionit(){
//define universal dsoc left point
var dsocleft=document.all? document.body.scrollLeft : pageXOffset
//define universal dsoc top point
var dsoctop=document.all? document.body.scrollTop : pageYOffset
//define universal browser window width
var window_width=document.all? document.body.clientWidth : window.innerWidth
//if the user is using IE 4+ or NS6+
if (document.all||document.getElementById){
crossobj.style.left=parseInt(dsocleft)+
parseInt(window_width)-135
crossobj.style.top=dsoctop+5
}
//else if the user is using NS 4
else if (document.layers){
crossobj.left=
dsocleft+window_width-140
crossobj.top=dsoctop+15
}
}
setInterval("positionit()",200)
</script>
heres the code im "trying" to use:
dosc:
<script language="JavaScript1.2">
document.write("Your browser\'s dimensions are: ")
//if browser supports window.innerWidth
if (window.innerWidth)
document.write(window.innerWidth+" by "+window.innerHeight)
//else if browser supports document.all (IE 4+)
else if (document.all)
document.write(document.body.clientWidth+" by "+document.body.clientHeight)
</script>
variables for banner:
<div id="staticbanner" style="position:absolute;">
Advertisement<br>
<a href="http://test.htm"><img
src="test.gif" width="120" height="90" alt="Click here!"
border="0"></a>
</div>
<script>
//define universal reference to "staticbanner"
var crossobj=document.all? document.all.staticbanner : document.getElementById? document.getElementById("staticbanner") : document.staticbanner
function positionit(){
//define universal dsoc left point
var dsocleft=document.all? document.body.scrollLeft : pageXOffset
//define universal dsoc top point
var dsoctop=document.all? document.body.scrollTop : pageYOffset
//define universal browser window width
var window_width=document.all? document.body.clientWidth : window.innerWidth
//if the user is using IE 4+ or NS6+
if (document.all||document.getElementById){
crossobj.style.left=parseInt(dsocleft)+
parseInt(window_width)-135
crossobj.style.top=dsoctop+5
}
//else if the user is using NS 4
else if (document.layers){
crossobj.left=
dsocleft+window_width-140
crossobj.top=dsoctop+15
}
}
setInterval("positionit()",200)
</script>