|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 | |
|
Member (3 bit)
Join Date: Apr 2004
Posts: 4
|
Javascript Question
Hi guys
The following piece of javascript works perfectly in IE but not in Mozilla, any ideas why? I don't have much experience writing js so the problem could be staring at me right in the face and i wouldn't know it According to what I have read it should work in MozillaThe problem is the top and left style settings don't seem to have any effect in Mozilla and the div remains in the top eft hand corner. function writeMenus() { //Passenger Services var passmenudiv = document.createElement('div'); var passdiv = document.getElementById('passenger_services'); document.body.appendChild(passmenudiv); passmenudiv.ID = 'menu_passenger_services'; //set the style passmenudiv.style.position = 'absolute'; passmenudiv.style.left = '500'; passmenudiv.style.top = '300'; passmenudiv.style.background = '#cfd9dd'; passmenudiv.style.border = 'thin solid #89a1aa'; //set the html var str = '
passmenudiv.innerHTML = str; } |
|
|
|
|
|
|
#2 |
|
Member (3 bit)
Join Date: Apr 2004
Posts: 4
|
Nevermind, problem solved! The correct code for Mozilla to understand is:
passmenudiv.style.left = '500px'; passmenudiv.style.top = '300px'; |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|