Jump to content

internet exploer giving error


ldb358

Recommended Posts

okay I'm making an "i.m. bar" that is supposed to be placed perfectly center on my web site, to make it easier to use in other projects i have it all done in JavaScript but on internet explorer and only internet explorer it is giving me an error on this code:

    imbar.style.left = ((window.innerWidth - 960)/2)+"px";
    imbar.style.right = ((window.innerWidth - 960)/2) +"px";

 

its giving me this error when i use the debugger

invalid argument      line 7 character 5
invalid argument      line 8 character 5

 

I've tried messing with gettting rid of the px and other things but then it breaks it in all of the browsers heres the script its from:

 

function imbar(){
    var newimbar = document.createElement('div');
    newimbar.setAttribute('id', 'imbar');
    document.getElementById('imbarholder').appendChild(newimbar);
    var imbar = document.getElementById('imbar');
    imbar.style.width = "940px";
    imbar.style.left = ((window.innerWidth - 960)/2)+"px";
    imbar.style.right = ((window.innerWidth - 960)/2) +"px";
    imbar.style.height = "25px";
    imbar.style.background = "#FFFFCC";
    imbar.style.border = "3px solid #000000";
    imbar.style.borderBottom = "none";
    imbar.style.position = "fixed";
    imbar.style.bottom = "0px";
    imbar.innerHTML = "<span id='onlineFriends' onclick='getFriends()'>Select a Friend to Chat With</span>";
}

 

thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/172488-internet-exploer-giving-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.