View Full Version : using javascript to statically place objects

06-02-2003, 09: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:

<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)


variables for banner:

<div id="staticbanner" style="position:absolute;">
<a href="http://test.htm"><img
src="test.gif" width="120" height="90" alt="Click here!"

//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){
//else if the user is using NS 4
else if (document.layers){

06-02-2003, 09:30 PM
and heres the spinmenu from javascriptkit:

<!--Step 1: Add the below SCRIPT to the head of your page:-->
<script type="text/javascript" src="spinmenu.js"></script>

<p>Example Spin Menu:</p>

<!--Step 2: Add the below SCRIPT to the body of your page where you want it to appear:-->

<script type="text/javascript">

3D Spin Menu- By Petre Stefan (http://www.eyecon.ro) w/ changes by JK
Visit JavaScript Kit (http://www.javascriptkit.com) for script
Keep this notice intact!

eye.isVertical = 0; //if it's vertical or horizontal [0|1]
eye.x = 500; // x offset from point of insertion on page
eye.y = 250; // y offset from point of insertion on page
eye.w = 150; // item's width
eye.h = 30; // height
eye.r = 100; // menu's radius
eye.v = 20; // velocity
eye.s = 8; // scale in space (for 3D effect)
eye.color = '#ffffff'; // normal text color
eye.colorover = '#ffffff'; // mouseover text color
eye.backgroundcolor = '#0099ff'; // normal background color
eye.backgroundcolorover = '#990000'; // mouseover background color
eye.bordercolor = '#000000'; //border color
eye.fontsize = 12; // font size
eye.fontfamily = 'Arial'; //font family
if (document.getElementById){
document.write('<div id="spinanchor" style="height:'+eval(eye.h+20)+'"></div>')
eye.x+=getposOffset(eye.anchor, "left") //relatively position it
eye.y+=getposOffset(eye.anchor, "top") //relatively position it

//menuitem: eye.spinmenuitem(text, link, target)
eye.spinmenuitem("JavaScript Kit","http://www.javascriptkit.com");
eye.spinmenuitem("Free JavaScripts","http://www.javascriptkit.com/cutpastejava.shtml");
eye.spinmenuitem("JS Tutorials","http://www.javascriptkit.com/javaindex.shtml");
eye.spinmenuitem("Advanced JS Tutorials","http://www.javascriptkit.com/javatutors/");
eye.spinmenuitem("DHTML/ CSS Tutorials","http://www.javascriptkit.com/dhtmltutors/index.shtml");
eye.spinmenuitem("Web building tutorials","http://www.javascriptkit.com/howto/");

<p align="left"><font face="arial" size="-2">This free script provided by<br>
<a href="http://javascriptkit.com">JavaScript Kit</a></font></p>


i dont want anybody to do it for me, i just figured itd be alot easier to diagnose the problem if you could see the script