cross browser objects 
Author Message
 cross browser objects

Hi,

I'm having a problem making my page cross-brower compatible.  The problem
occurs where I try to use scripting.  Before i used DIV tags and in IE these
allowed scripting, but not so in Netscape.  So instead I decided to use <a
href=.....> inside my div tags.
So I have:
<DIV ID="TestLayer" STYLE="position:absolute;
left:30px; top:200;  width:230; height:120; background-color:#C0C0C0;
layer-background-color:#C0C0C0;visibility:visible;}">

<a name="blah" href="javascript:mouseclick(this)" onMouseOver="
mouseon(this);"
         onMouseOut="mouseout(this)" text="the actual text">
some text
       </a>
</DIV>
This is now almost working.
 The problem is now that where before I would pass my object events to the
JS functions with
onmouseclick=Click(this); but now this isn't an object. (Note that by
setting the name attribute it actually causes the object to behave
differently)  Is there any way of referencing the containing div tag(ie
TestLayer)?
Also the < a> tag is supposed to have a text property.  However it doesn't
seem to display this.  Does anyone know of any way to display this?

Thanks,
Stephen



Sat, 08 Feb 2003 03:00:00 GMT  
 cross browser objects
Hi

Really simple example :)

<div id="Daddy">
<a href="#" onmouseover="alert(this.parentElement.id)">bla</a>
</div>

Here is more info:

http://msdn.microsoft.com/workshop/

--
Best Regards
  Vidar Petursson
 ==============================
 Microsoft Internet, Client, SDK MVP
 ==============================
 http://www.icysoft.com
 http://www.dna.is



 ==============================
 No matter where you go there you are


Quote:
> Hi,

> I'm having a problem making my page cross-brower compatible.  The problem
> occurs where I try to use scripting.  Before i used DIV tags and in IE
these
> allowed scripting, but not so in Netscape.  So instead I decided to use <a
> href=.....> inside my div tags.
> So I have:
> <DIV ID="TestLayer" STYLE="position:absolute;
> left:30px; top:200;  width:230; height:120; background-color:#C0C0C0;
> layer-background-color:#C0C0C0;visibility:visible;}">

> <a name="blah" href="javascript:mouseclick(this)" onMouseOver="
> mouseon(this);"
>          onMouseOut="mouseout(this)" text="the actual text">
> some text
>        </a>
> </DIV>
> This is now almost working.
>  The problem is now that where before I would pass my object events to the
> JS functions with
> onmouseclick=Click(this); but now this isn't an object. (Note that by
> setting the name attribute it actually causes the object to behave
> differently)  Is there any way of referencing the containing div tag(ie
> TestLayer)?
> Also the < a> tag is supposed to have a text property.  However it doesn't
> seem to display this.  Does anyone know of any way to display this?

> Thanks,
> Stephen



Sat, 08 Feb 2003 03:00:00 GMT  
 cross browser objects

Thanks,

However in Netscape I am told that the parentElement does not exist. Is this
due to the different object layout in Netscape, and if so does anyone know
how to access the parent Element in Netscape.


Quote:
> Hi

> Really simple example :)

> <div id="Daddy">
> <a href="#" onmouseover="alert(this.parentElement.id)">bla</a>
> </div>

> Here is more info:

> http://msdn.microsoft.com/workshop/

> --
> Best Regards
>   Vidar Petursson
>  ==============================
>  Microsoft Internet, Client, SDK MVP
>  ==============================
>  http://www.icysoft.com
>  http://www.dna.is



>  ==============================
>  No matter where you go there you are



> > Hi,

> > I'm having a problem making my page cross-brower compatible.  The
problem
> > occurs where I try to use scripting.  Before i used DIV tags and in IE
> these
> > allowed scripting, but not so in Netscape.  So instead I decided to use
<a
> > href=.....> inside my div tags.
> > So I have:
> > <DIV ID="TestLayer" STYLE="position:absolute;
> > left:30px; top:200;  width:230; height:120; background-color:#C0C0C0;
> > layer-background-color:#C0C0C0;visibility:visible;}">

> > <a name="blah" href="javascript:mouseclick(this)" onMouseOver="
> > mouseon(this);"
> >          onMouseOut="mouseout(this)" text="the actual text">
> > some text
> >        </a>
> > </DIV>
> > This is now almost working.
> >  The problem is now that where before I would pass my object events to
the
> > JS functions with
> > onmouseclick=Click(this); but now this isn't an object. (Note that by
> > setting the name attribute it actually causes the object to behave
> > differently)  Is there any way of referencing the containing div tag(ie
> > TestLayer)?
> > Also the < a> tag is supposed to have a text property.  However it
doesn't
> > seem to display this.  Does anyone know of any way to display this?

> > Thanks,
> > Stephen



Sun, 09 Feb 2003 03:00:00 GMT  
 cross browser objects
Hi

Well the simplest way would be to pass the element you want
to affect

<a href="bla" onmouseover="someFunction(theDivID)">bla</a>

--
Best Regards
 Vidar Petursson
==============================
  Microsoft Internet, Client, SDK MVP
==============================
 http://www.icysoft.com
 http://www.dna.is



==============================
 No matter where you go there you are
-

Quote:
> Thanks,

> However in Netscape I am told that the parentElement does not exist. Is
this
> due to the different object layout in Netscape, and if so does anyone know
> how to access the parent Element in Netscape.



> > Hi

> > Really simple example :)

> > <div id="Daddy">
> > <a href="#" onmouseover="alert(this.parentElement.id)">bla</a>
> > </div>

> > Here is more info:

> > http://msdn.microsoft.com/workshop/

> > --
> > Best Regards
> >   Vidar Petursson
> >  ==============================
> >  Microsoft Internet, Client, SDK MVP
> >  ==============================
> >  http://www.icysoft.com
> >  http://www.dna.is



> >  ==============================
> >  No matter where you go there you are



> > > Hi,

> > > I'm having a problem making my page cross-brower compatible.  The
> problem
> > > occurs where I try to use scripting.  Before i used DIV tags and in IE
> > these
> > > allowed scripting, but not so in Netscape.  So instead I decided to
use
> <a
> > > href=.....> inside my div tags.
> > > So I have:
> > > <DIV ID="TestLayer" STYLE="position:absolute;
> > > left:30px; top:200;  width:230; height:120; background-color:#C0C0C0;
> > > layer-background-color:#C0C0C0;visibility:visible;}">

> > > <a name="blah" href="javascript:mouseclick(this)" onMouseOver="
> > > mouseon(this);"
> > >          onMouseOut="mouseout(this)" text="the actual text">
> > > some text
> > >        </a>
> > > </DIV>
> > > This is now almost working.
> > >  The problem is now that where before I would pass my object events to
> the
> > > JS functions with
> > > onmouseclick=Click(this); but now this isn't an object. (Note that by
> > > setting the name attribute it actually causes the object to behave
> > > differently)  Is there any way of referencing the containing div
tag(ie
> > > TestLayer)?
> > > Also the < a> tag is supposed to have a text property.  However it
> doesn't
> > > seem to display this.  Does anyone know of any way to display this?

> > > Thanks,
> > > Stephen



Sun, 09 Feb 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. cross-browser scripting

2. Setting background color - cross-browser?

3. Cross Browser Compadabillity

4. cross browser linking

5. Cross - Browser input field problems

6. cross browser java detection

7. Cross-browser Drop-Down Lists

8. cross browser drag and drop using Javascript

9. Cross Browser Implementation, Help!

10. cross-browser DHML warriors needed..

11. Sarissa, a cross browser JS API for DOM extentions

12. cross browser compliant show / hide

 

 
Powered by phpBB® Forum Software