Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.