Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Div tag problem in Mozilla

Reply
Thread Tools

Div tag problem in Mozilla

 
 
conckrish@gmail.com
Guest
Posts: n/a
 
      07-12-2006
Hai All,

In my ASP.NET application, I have created a popup window using a
mouseover event for Label.I have placed all popup controls inside a div
tag.This popup working well in IE,but not working in mozilla.. How to
solve this div tag problem?? How to show the Popup ib Mozilla?



My code look like this :
=================

<div class="PopUptransparent" id="PopUp">
<table class="PopUpMainTable" id="PopupTable" cellSpacing="0"
cellPadding="0" width="238"
border="0">
<tr>
<td class="PopupBoldTxtBlack" id="lblRemaining" style="PADDING-LEFT:
3px; PADDING-BOTTOM: 7px; PADDING-TOP: 7px; BORDER-BOTTOM: #99ccff 1px
solid"
width="40%"></td>
<td class="PopupBoldTxtRed" id="lblRemainingVal"
style="PADDING-RIGHT: 5px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px;
BORDER-BOTTOM: #99ccff 1px solid"
width="60%"></td>
</tr>
..
..
..
..
..
</table>
</div>



function ShowAuctionDetailPopUp(RemainingName)
{
var X;
var Y;

document.getElementById('lblRemaining').innerText= RemainingName;
document.getElementById('lblRemainingVal').innerTe xt=RemainingVal;


var pos = getElementPos(CtrlId);
X= pos.x;
Y= window.event.clientY+document.body.scrollTop+8;
PopUp.style.left = X;
PopUp.style.top = Y;

PopUp.style.display='block';
PopUp.style.position= 'absolute';
PopUp.style.left = X;
PopUp.style.top = Y;
}
function getElementPos(sElementID)
{
if(!document.getElementById) return null;
var e = document.getElementById(sElementID);
if(e == null ) return null;
var p = { x: 0, y: 0};
while(e)
{
p.x += parseInt(e.offsetLeft,10);
p.y += parseInt(e.offsetTop,10);
e = e.offsetParent;
}
return p;
}

 
Reply With Quote
 
 
 
 
Richard Cornford
Guest
Posts: n/a
 
      07-12-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
<snip>
> <div class="PopUptransparent" id="PopUp">

<snip>
> Y= window.event.clientY+document.body.scrollTop+8;


Mozilla/Gecko browsers do not have a global event object, they pass an
event object as an argument ot the event handler instead).

> PopUp.style.left = X;

<snip>

Treating the ID attribute of an element as the name of a global variable
that refers to the element is taking advantage of a non-standard
approach implemented by Microsoft in IE but mostly not in Mozilla/Gecko
browsers.

Non-zero style values are required to include a specification of the
unit being used. Some browser interpret values assigned without units as
values with pixel units, but this type of error-correction is not
universally implemented (or in any way required).

Richard.


 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      07-12-2006
(E-Mail Removed) wrote:
[...]

> document.getElementById('lblRemaining').innerText= RemainingName;


innerText is a proprietary IE property that is not supported by many
other browsers. The W3C equivalent is textContent. Search for
cross-browser solutions in the archives.

<URL:http://groups.google.com.au/group/comp.lang.javascript/search?q=innertext+textContent+robg&start=0&scorin g=d&>

[...]

--
Rob
 
Reply With Quote
 
conckrish@gmail.com
Guest
Posts: n/a
 
      07-12-2006
Dear Richard,

Thnx for ur reply.. Can u explain bit elabrotaly ?? How to
solve this prob?? Plz give some code snips ...


Richard Cornford skrev:

> (E-Mail Removed) wrote:
> <snip>
> > <div class="PopUptransparent" id="PopUp">

> <snip>
> > Y= window.event.clientY+document.body.scrollTop+8;

>
> Mozilla/Gecko browsers do not have a global event object, they pass an
> event object as an argument ot the event handler instead).
>
> > PopUp.style.left = X;

> <snip>
>
> Treating the ID attribute of an element as the name of a global variable
> that refers to the element is taking advantage of a non-standard
> approach implemented by Microsoft in IE but mostly not in Mozilla/Gecko
> browsers.
>
> Non-zero style values are required to include a specification of the
> unit being used. Some browser interpret values assigned without units as
> values with pixel units, but this type of error-correction is not
> universally implemented (or in any way required).
>
> Richard.


 
Reply With Quote
 
Richard Cornford
Guest
Posts: n/a
 
      07-12-2006
(E-Mail Removed) wrote:
> Dear Richard,
>
> Thnx for ur reply.. Can u explain bit elabrotaly ?? How to
> solve this prob?? Plz give some code snips ...


Can you ask that question in the normal semantic and syntactic units of
a human language (for practical reasons maybe one I would understand)?

> Richard Cornford skrev:

<snip- top post>

And formatted as a normal Usenet post?

Richard.

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<div ... /> and <div ...></div> K Viltersten ASP .Net 4 03-31-2009 07:33 PM
Select text within a div tag by clicking on content of div tag or a button? visu Javascript 4 11-22-2006 06:25 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Q: Div A inside Div B is larger than Div B Dwayne Madsen Javascript 1 06-01-2005 03:02 PM
Select text within a div tag by clicking on content of div tag? M Wells Javascript 0 10-06-2004 11:04 AM



Advertisments