JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 11th, 2012, 05:05 PM
kusalo kusalo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 22 kusalo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 57 m 25 sec
Reputation Power: 0
X/y position of nested div - IE?

I have a tabbed environment.
Parent div with a div for each tab.
Inside one tab are a set of options - each a div.
On selecting one of the options a greyed-out div is laid over the other divs rendering them inoperable so only one option can be fed to the form.

This code works well - but IE doesn't like it (the nested divs?).
It gets the size right but not x or y pos.
I wonder about using jquery - ?
I generally wonder
Any suggestions would be most welcome.

Code:
function disableDivs() {
d = document.getElementsByTagName("BODY")[0];
for(x=0;x<arguments.length;x++) { if (document.getElementById(arguments[x])) {
    xPos = document.getElementById(arguments[x]).offsetLeft; 
    yPos = document.getElementById(arguments[x]).offsetTop;
    oWidth = document.getElementById(arguments[x]).offsetWidth;    
    oHeight = document.getElementById(arguments[x]).offsetHeight;
    cDivs[cDivs.length] = document.createElement("DIV");
    cDivs[cDivs.length-1].style.width = oWidth+"px";
    cDivs[cDivs.length-1].style.height = oHeight+"px";
    cDivs[cDivs.length-1].style.position = "absolute";
    cDivs[cDivs.length-1].style.left = xPos+"px";
    cDivs[cDivs.length-1].style.top = yPos+"px";
    cDivs[cDivs.length-1].style.backgroundColor = "#999999";
    cDivs[cDivs.length-1].style.opacity = .5;
    cDivs[cDivs.length-1].style.filter = "alpha(opacity=50)";
    d.appendChild(cDivs[cDivs.length-1]); }}}
function hideCDivs() { for (hippopotamus=0;hippopotamus<cDivs.length;hippopotamus++) {
document.getElementsByTagName("BODY")[0].removeChild(cDivs[hippopotamus]); }
cDivs = []; }

Reply With Quote
  #2  
Old September 12th, 2012, 10:08 PM
kusalo kusalo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 22 kusalo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 57 m 25 sec
Reputation Power: 0
Still no closer...
I wonder if the offset value is the problem?

I suspect there is not much missing - other than my lack of js

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > X/y position of nested div - IE?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap