Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question spinmenu javascript, one tiny error, need help.

    I recently did up a page with this script (already uploaded the necessary .js file to my server B.T.W.):


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

    <body>
    <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 = 150; // x offset from point of insertion on page
    eye.y = 0; // 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.anchor=document.getElementById('spinanchor')
    eye.spinmenu();
    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/");
    eye.spinmenuclose();
    }
    </script>

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

    </body>


    But I then made some changes to my site most notably this:

    <script LANGUAGE="JavaScript"><!--
    // Preload and play audio files with event handler (MouseOver sound)
    // designed by JavaScript Archive, (c)1999
    // Get more free javascripts at http://jsarchive.8m.com

    var aySound = new Array();
    aySound[1] = "http://mysite.com/sounds/appreciate.wav";
    // DO NOT edit below this line
    document.write('<BGSOUND ID="auIEContainer">')
    IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
    NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
    ver4 = IE||NS? 1:0;
    onload=auPreload;

    function auPreload() {
    if (!ver4) return;
    if (NS) auEmb = new Layer(0,window);
    else {
    Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
    document.body.insertAdjacentHTML("BeforeEnd",Str);
    }
    var Str = '';
    for (i=0;i<aySound.length;i++)
    Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
    if (IE) auEmb.innerHTML = Str;
    else {
    auEmb.document.open();
    auEmb.document.write(Str);
    auEmb.document.close();
    }
    auCon = IE? document.all.auIEContainer:auEmb;
    auCon.control = auCtrl;
    }
    function auCtrl(whSound,play) {
    if (IE) this.src = play? aySound[whSound]:'';
    else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
    }
    function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
    function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
    //-->
    </script>

    to the HEAD, and this:

    <p align="center"><a href="http://www.mysite.com" onMouseOver="playSound(1)" onMouseOut="stopSound(1)"><img src="../../mysite/images/button.gif" alt="Go Home" width="30" height="32"><BR><B><font size="1">Go Home</font></B></a></p>

    to the BODY.

    Script 1 (the one with the problem) I got off of Javascriptkit.
    Both scripts work fine together except one small glitch where the spinmenu LEFT and RIGHT input buttons are off centered to the right when page loads and then when I click on either of the buttons it shifts normal centered. Any idea why the initial misalignment? I have no other script on the page, just images and text.
    Thanks!
    Eli

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    hm... maybe some objects are positioned relative, not absolute, so if you insert other objects in body, positioned nomatter how, you have to modify the left and top position of some of them... or to make it absolute, for avoinding that....
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Jul 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    so what your saying is...

    So what your saying is if I alter my x and y for the spin menue?
    Is it a layout thing?
    confused.

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    I don't know for sure, I can not see that "spinmenu.js". What I am saying is that sometimes it happen so when use two or more scripts, or you insert other objects, if one of them uses relative positioning
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •