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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem Using script

    Hi,
    I have this script I took as a freeware ,
    My problems with this are :
    a. when I put it in aspx page it is not working properly in firefox
    b. I would like to use my owen buttons instead of the system buttons
    c. I cant put it in a div sot it will be in a position relative to the div in the page

    This is the js:


    eye={p:0,x:0,y:0,w:0,h:0,r:0,v:0,s:0,isVertical:0,a1:0,a2:0,a3:0,color:'#ffffff',colorover:'#ffffff' ,backgroundcolor:'#0099ff',backgroundcolorover:'#000000',bordercolor:'#000000',fontsize:12,fontfamil y:'Arial',pas:0,spinmenu:function(){this.p=this.r/this.s;this.a1=this.a2=this.isVertical?0:Math.PI/2},spinmenuitem:function(a7,a6,a5){a4=" onclick='window.open(\""+a6+"\""+(a5?(",\""+a5+"\""):",\"_self\"")+")'";document.write("<div id='spinmenu"+this.a3+"' style='cursorointer;cursor:expression(\"hand\");position:absolute;width:"+this.w+"px;left:"+this.h+"px;"+"backgro und-color:"+this.backgroundcolor+";color:"+this.color+";border:1px solid "+this.bordercolor+";font:normal "+this.fontsize+"px "+this.fontfamily+";text-align:center;cursor:default;z-Index:1000;' onmouseover='this.style.color=\""+this.colorover+"\";this.style.backgroundColor=\""+this.backgroundc olorover+"\"'"+ "onmouseout='this.style.color=\""+this.color+"\";this.style.backgroundColor=\""+this.backgroundcolor +"\"'"+a4+">"+a7+"</div>");this.a3++},muta:function(){a8=document.getElementById("controale");for(i=0;i<this.a3;i++){a9= document.getElementById("spinmenu"+i+"");a9s=a9.style;if(this.isVertical){xi=parseInt(this.r*Math.co s(this.a1+i*this.pas))/this.s;yi=parseInt(this.r*Math.sin(this.a1+i*this.pas));a10=(this.p+xi)/(2*this.p);a11=this.fontsize*(this.p+xi)/(2*this.p)+2;a12=parseInt(100*(this.p+xi)/(2*this.p))}else{xi=parseInt(this.r*Math.cos(this.a1+i*this.pas));yi=parseInt(this.r*Math.sin(this.a 1+i*this.pas))/this.s;a10=(this.p+yi)/(2*this.p);a11=this.fontsize*(this.p+yi)/(2*this.p)+2;a12=parseInt(100*(this.p+yi)/(2*this.p))};a13=(this.w-20)*a10+20;a14=(this.h-20)*a10+10;a9s.top=(yi+this.y-a14/2)+"px";a9s.left=(xi+this.x-a13/2)+"px";a9s.width=a13+"px";a9s.fontSize=a11+"px";a9s.zIndex=a12};a8.style.top=this.y+(this.isVertica l?this.r:this.p)+this.h/2+6;a8.style.left=this.x-a8.offsetWidth/2;if(this.a1!=this.a2){this.a1=(this.a1>this.a2)?(this.a1-this.pas/this.v)this.a1+this.pas/this.v);if(Math.abs(this.a1-this.a2)<this.pas/this.v)
    this.a1 = this.a2; setTimeout("eye.muta()", 10)
    }
    }, spinmenuclose: function() { this.pas = 2 * Math.PI / this.a3; document.write('<div id="controale" style="position:absolute"><button type="" onclick="eye.a2+=eye.pas;eye.muta()" onfocus="this.blur()" >&lt;&lt; Spin Left </button> <button type="" onclick="eye.a2-=eye.pas;eye.muta()" onfocus="this.blur()">Spin Right &gt;&gt;</button></div>'); eye.muta() }
    };

    function getposOffset(what, offsettype){var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;var parentEl=what.offsetParent;while (parentEl!=null){totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft :totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}return totaloffset;
    }


    And this is the script

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

    Thanks for all the help
    A

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,802
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    You are not following the rules and posting guidelines of this forum.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    My apology , (i'm new here)

    Quote Originally Posted by abduraooft View Post
    You are not following the rules and posting guidelines of this forum.
    What did i do wrong?


  •  

    Posting Permissions

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