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
    May 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question JavaScript - Not Working in IE

    I working on a site re-design and I have run into some trouble when I tested the site in IE.
    Please take a look at the site:
    HERES THE SITE

    I generaly use Mozilla and the floating Div displays fine. I will past the code but you can may also want to do a View Page Source.

    I have given the Div and ID name of "FloatLayer" which is refered to in the JS. Just incase your wondering.

    Ok so heres the JS code place below my Menu/DIV

    PHP Code:
    <script language="JavaScript" type="text/JavaScript">
    var 
    hX 'centre';
    var 
    vY 291;
    var 
    nn=(navigator.appName.indexOf("Netscape")!=-1);
    var 
    dD=document,dH=dD.html,dB=dD.body,px=dD.layers?'':'px';

    function 
    floatLayer(iX,iY,id){
    var 
    L=dD.getElementById?dD.getElementById(id):dD.all?dD.all[id]:dD.layers[id];
    this[id+'O']=L;
    if(
    dD.layers)L.style=L;
    L.nX=L.iX=iX;
    L.nY=L.iY=iY;

    L.P=function(x,y){
    this.style.left=x+px;
    this.style.top=y+px;
    }
    L.Fm=function(){
    var 
    pXpY;
    pX=(this.iX >=0)?0:nn?innerWidth:nn&&dH.clientWidth?dH.clientWidth:dB.clientWidth;
    pY=nn?pageYOffset:nn&&dH.scrollTop?dH.scrollTop:dB.scrollTop;
    if(
    this.iY<0)pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;
    this.nX+=.1*(pX+this.iX-this.nX);
    this.nY+=.1*(pY+this.iY-this.nY);
    this.P(this.nX,this.nY);
    setTimeout(this.id+'O.Fm()',33);
    }
    return 
    L;
    }
    floatLayer(hX,vY,'FloatLayer').Fm();
    </script> 

    I would really appreciate some help with this ASAP! as its an urgent matter for me.

    Biggest thanks in advance EVER

  • #2
    New to the CF scene
    Join Date
    May 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just received a PM from FCI, who offered some kind advice and that was to replace the code.

    PHP Code:
    L.P=function(x,y){
    this.style.left=x+px;
    this.style.top=y+px;

    With...

    PHP Code:
    L.P=function(x,y){
        try {
            
    this.style.left=x+px;
            
    this.style.top=y+px;
        } catch(
    e) {
            
    this.style.pixelLeft=x+'px';
            
    this.style.pixelTop=y+'px';
        }

    But unfortunately this did not help what this did was position the DIV/Menu in the top left hand corner and was still un-scrollable/floating when viewing in IE. But again showd fine in Mozilla?

    Just thort the above ^^ would be worth mentioning and maybe lead someone in the direction to solving my problem.
    Last edited by FlawedKid; 05-02-2006 at 10:55 PM.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Hmm I don't know dom well enough to understand your code but I see that hX is spelt centre. CSS uses the American spellings center (I'm American BTW). Perhaps the spelling of center has something to with it? This menu may or may not give you some inspiration. http://www.dynamicdrive.com/dynamici...taticmenu3.htm
    You can probably even do this whole thing with out javascript well for Firefox anyways.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New to the CF scene
    Join Date
    May 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank for the post,

    I am Australian hence the spelling 'centre'. I made the changes using the american lingo but it made not difference GOD DAM IE why can't everyone just use MOZ!

    Any other suggestions are more than welcome


  •  

    Posting Permissions

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