Damn IE. Ok thanks. I am going to take away elements from the page where is the conflict. Thanks for your time.
Juan Diego On Sep 21, 4:49 am, Kevin Porter <k...@9ballpool.co.uk> wrote: > Sorry, I didn't try your page, I was just using the test page I built to > test your code. > > You're right, IE8 gives an error on your page. > > It's complaining about this line: > > var e2 = element.up().up().up().next(); > > You'll just have to debug - please find out exaclty what you get for > element.up(), element.up().up() etc. At some point > it's behaviour is differing from Firefox - when you find out what that > is we'll try and figure why the behaviour is different. > > One thing I would suggest trying (from previous IE LI difficulties) is > to remove all whitespace from the UL/LI markup. However, the docs for > next() and up() say that whitespace nodes are totally ignored by these > functions, so that may not be the problem but it's probably worth a > minute to try. > > Alternatively, you could try using a css rule in up() > (http://www.prototypejs.org/api/element/up) , eg: > > var e2 = element.up('div.lista_izq').next(); > > Let me know how you get on. If those alternative suggestions don't work, > we really need you to debug to find out at exactly which point the IE8 > behaviour is differing from that of normal browsers. > > regards, > > - Kev > > Juan Diego wrote: > > It is still not working. I am going to try in another machine. I get > > this error because the browser is in spanish. El objeto no acepta > > esta propiedad o metodo. Which means the object does not accept this > > property or method in the lines 15 and 28. > > > On Sep 21, 4:23 am, Kevin Porter <k...@9ballpool.co.uk> wrote: > > >> It works for me in IE8! > > >> Kill IE8, re-open it and try again. > > >> If it still doesn't work, what error are you getting? > > >> regards, > > >> - Kev > > >> Juan Diego wrote: > > >>> I cleaned up a little my code it still doesnt work in IE8 > > >>> this is the code > >>> function reemplazarX(){ > >>> var element = this; > >>> //var e2 =element.getOffsetParent(); > >>> var e2 =element.up().up().up().next(); > >>> //alert(e2); > >>> e2.setStyle({ > >>> backgroundColor: '#020506', > >>> opacity: 1.0, > >>> borderLeft:'1px #FFF solid' > >>> }); > >>> e2.innerHTML= element.next().innerHTML; > > >>> } > >>> function borrar(){ > >>> var element = this; > >>> //var e2 =element.getOffsetParent(); > >>> var e2 =element.up().up().up().next(); > >>> e2.innerHTML= ""; > >>> e2.setStyle({ > >>> backgroundColor: '#000', > >>> opacity: 0.0 > >>> }); > >>> } > > >>> On Sep 21, 3:59 am, Juan Diego <juandieg...@gmail.com> wrote: > > >>>> I dont want the LI elements. Here is how it is setup, > > >>>> <div class="lista_izq"> > >>>> <ul> > >>>> <li><div class="text">text1</div> > >>>> <div class="hidden_text">hidden1</div> > >>>> </li> > >>>> <li><div class="text">text2</div> > >>>> <div class="hidden_text">hidden2</div> > >>>> </li> > >>>> </ul> > >>>> </div> > >>>> <div class="lista_der"> </div> > >>>> I want display my message in lista_der. So that is why i use all > >>>> those up(), i guess I can use 4 up and one next. > > >>>> On Sep 21, 3:50 am, Kevin Porter <k...@9ballpool.co.uk> wrote: > > >>>>> First things first - you've got four up()s in a row, which is likely to > >>>>> return you the document or window object. > > >>>>> If you want the LI element you only need one up() from the div. > > >>>>> regards, > > >>>>> - Kev > > >>>>> JuanDiegowrote: > > >>>>>> I used up() and didnt work, it is the same error. > >>>>>> Here is the test page > >>>>>>http://pts.raidenenergy.com/index.php?option=com_content&view=categor... > > >>>>>> and this is the code. > > >>>>>> function listas(){ > >>>>>> $$('div.texto').each(function(s) { Event.observe(s, 'mouseover', > >>>>>> reemplazarX)}); > >>>>>> $$('div.texto').each(function(s) { Event.observe(s, 'mouseout', > >>>>>> borrar)}); > >>>>>> }; > > >>>>>> function reemplazarX(){ > >>>>>> var element = this; > >>>>>> //var e2 =element.getOffsetParent(); > >>>>>> var e2 =element.up().up().up().up(); > >>>>>> //alert(e2); > >>>>>> e2.childElements()[2].setStyle({ > >>>>>> backgroundColor: '#020506', > >>>>>> opacity: 1.0, > >>>>>> borderLeft:'1px #FFF solid' > >>>>>> }); > >>>>>> e2.childElements()[2].innerHTML= element.next().innerHTML; > > >>>>>> } > >>>>>> function borrar(){ > >>>>>> var element = this; > >>>>>> //var e2 =element.getOffsetParent(); > >>>>>> var e2 =element.up().up().up().up(); > >>>>>> e2.childElements()[2].innerHTML= ""; > >>>>>> e2.childElements()[2].setStyle({ > >>>>>> backgroundColor: '#000', > >>>>>> opacity: 0.0 > >>>>>> }); > >>>>>> } > > >>>>>> On Sep 18, 5:27 am, david <david.brill...@gmail.com> wrote: > > >>>>>>> HiJuan, > > >>>>>>> IE has much trouble with table. So not surprinsing that IE doesn't > >>>>>>> work as expected. > > >>>>>>> -- > >>>>>>> david > > >>>>>>> On 17 sep, 19:10,JuanDiego<juandieg...@gmail.com> wrote: > > >>>>>>>> Thanks. > >>>>>>>> One more thing, I am doing this inside a joomla so those divs are > >>>>>>>> inside a table inside the"content" module of joomla. When ever I use > >>>>>>>> alert(e2) I thought i was getting the table, because it said > >>>>>>>> something > >>>>>>>> about "table element", so for some reason in internet explorer it > >>>>>>>> goes > >>>>>>>> directly to the body. That is what it is happening right? I am > >>>>>>>> going > >>>>>>>> to try with teh up() function. > > >>>>>>>> Ken I am using [2] because there is some text with <p></p> that i > >>>>>>>> though it wasnt important. But thanks for noticing. > > >>>>>>>> Juan > > >>>>>>>> On Sep 17, 6:08 am, david <david.brill...@gmail.com> wrote: > > >>>>>>>>> Hi Kev, > > >>>>>>>>> the getOffSetParent() return the "closest positioned ancestor", and > >>>>>>>>> if > >>>>>>>>> not found return the body ! > >>>>>>>>> That's why for some element, parent is not positionned (CSS position > >>>>>>>>> property) and it return the body element. > > >>>>>>>>> As you say, up() is much more appropriate in this case. > > >>>>>>>>> -- > >>>>>>>>> david > > >>>>>>>>> On 17 sep, 10:38, Kevin Porter <k...@9ballpool.co.uk> wrote: > > >>>>>>>>>> HiJuan, > > >>>>>>>>>> For me, I get the error at "e2.childElements()[2].setStyle...". > >>>>>>>>>> e2 at that point is the body element. Is that what you want? > >>>>>>>>>> I guess you want the LI element? If so, maybe .up() would be a > >>>>>>>>>> better > >>>>>>>>>> choice than .getOffSetParent()? > >>>>>>>>>> Also, you probably want to use "[1]" instead of "[2]" to reference > >>>>>>>>>> the > >>>>>>>>>> second element of the LI. (it's > >>>>>>>>>> a zero-indexed array). > > >>>>>>>>>> regards, > > >>>>>>>>>> - Kev > > >>>>>>>>>> JuanDiegowrote: > > >>>>>>>>>>> Ok, so I cleaned up my code. I used "each" instead of a For > >>>>>>>>>>> loop, so > >>>>>>>>>>> now it works in every Browser except IE8. I havent tested it in > >>>>>>>>>>> other > >>>>>>>>>>> versions of IE. Like 6 o 7. > >>>>>>>>>>> So here is the code. > > >>>>>>>>>>> function listas(){ > >>>>>>>>>>> $$('div.texto').each(function(s) { Event.observe(s, > >>>>>>>>>>> 'mouseover', > >>>>>>>>>>> reemplazarX)}); > >>>>>>>>>>> $$('div.texto').each(function(s) { Event.observe(s, 'mouseout', > >>>>>>>>>>> borrar)}); > >>>>>>>>>>> }; > > >>>>>>>>>>> function reemplazarX(){ > >>>>>>>>>>> var element = this; > >>>>>>>>>>> var e2 =element.getOffsetParent(); > >>>>>>>>>>> alert(e2); > >>>>>>>>>>> e2.childElements()[2].setStyle({ > >>>>>>>>>>> backgroundColor: '#020506', > >>>>>>>>>>> opacity: 1.0, > >>>>>>>>>>> borderLeft:'1px #FFF solid' > >>>>>>>>>>> }); > >>>>>>>>>>> e2.childElements()[2].innerHTML= element.next().innerHTML; > > >>>>>>>>>>> } > >>>>>>>>>>> function borrar(){ > >>>>>>>>>>> var element = this; > >>>>>>>>>>> var e2 =element.getOffsetParent(); > >>>>>>>>>>> e2.childElements()[2].innerHTML= ""; > >>>>>>>>>>> e2.childElements()[2].setStyle({ > >>>>>>>>>>> backgroundColor: '#000', > >>>>>>>>>>> opacity: 0.0 > >>>>>>>>>>> }); > >>>>>>>>>>> } > > >>>>>>>>>>> I get an error on Line 14. "The object does not accept this > >>>>>>>>>>> property > >>>>>>>>>>> or method" So the problem seems to be in this line var e2 > >>>>>>>>>>> =element.getOffsetParent(); > >>>>>>>>>>> With getOffsetParent function. > > >>>>>>>>>>> This code works in opera, konqueror, safari, firefox. > > >>>>>>>>>>> Thanks > > >>>>>>>>>>> On Sep 17, 12:36 am,JuanDiego<juandieg...@gmail.com> wrote: > > >>>>>>>>>>>> By the way i just found out that > >>>>>>>>>>>> var > >>>>>>>>>>>> lista_izq=$$('div.lista_izq')[i].childElements()[0].childElements > >>>>>>>>>>>> (); > >>>>>>>>>>>> is the problem in IE explorer. In opera works but in IE8 is a > >>>>>>>>>>>> problem > > >>>>>>>>>>>> On Sep 17, 12:19 am,JuanDiego<juandieg...@gmail.com> wrote: > > >>>>>>>>>>>>> Hi I havent use javascript and prototype in a while so maybe i > >>>>>>>>>>>>> am > >>>>>>>>>>>>> doing something really wrong. > >>>>>>>>>>>>> So here is what I am trying to do with prototype > >>>>>>>>>>>>> I have a a few places in my page with a set of to divs divs, > > ... > > read more » --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---