[Proto-Scripty] Re: Events not working as expected in opera, ie or any other browser except firefox
Ok so i find out the source of the problem, not a solution yet, but i know what is the problem. The flash module in my joomla page has this mootools.js library that for some reasons in IE8 conflicts or creates that problem, i am going to try some work around. Juan Diego On Sep 21, 7:04 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi Juan, I've only skimmed this, so apologies if this comment is completely off- base, but you mentioned tables in there somewhere although I don't see any tables in the HTML snippets. Do all of your tables have the appropriate TBODY elements in them? I can see that being a difference between browsers, particularly depending on what your DOCTYPE is. It's a surprisingly well-kept secret that TR cannot appear directly within TABLE, you must have a TBODY (or THEAD or TFOOT) in between: table tr tdThis/td /tr tr tdis/td /tr tr tdWRONG/td /tr /table table tbody tr tdThis/td /tr tr tdis/td /tr tr tdright/td /tr /tbody /table Firefox will silently insert one for you; I don't know what IE's behavior is (whether it inserts one or just doesn't worry about it). Again, apologies if this is completely off-base. Oh, and separately: If you find yourself writing: someElement.up().up() you can use someElement.up(1) ...instead. (Yes, really 1, not 2 -- up() equals up(0), so up().up() equals up(1). *Terrible* API choice, but there we are. Details in the old API docs[1].) [1]http://prototypejs.org/api/element/up Good luck, -- T.J. Crowder tj / crowder software / comwww.crowdersoftware.com On Sep 21, 11:08 am, Juan Diego juandieg...@gmail.com wrote: 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 lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/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
[Proto-Scripty] Re: Events not working as expected in opera, ie or any other browser except firefox
I used up() and didnt work, it is the same error. Here is the test page http://pts.raidenenergy.com/index.php?option=com_contentview=categorylayout=blogid=8Itemid=14lang=en 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,JuanDiegojuandieg...@gmail.com wrote: Thanks. One more thing, I am doing this inside a joomla so those divs are inside a table inside thecontent 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,JuanDiegojuandieg...@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,JuanDiegojuandieg...@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, lista_izq and lista_der, with a list inside list_izq div class=lista_izq ul lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/div So when ever the mouse is over the text1 or
[Proto-Scripty] Re: Events not working as expected in opera, ie or any other browser except firefox
I dont want the LI elements. Here is how it is setup, div class=lista_izq ul lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/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_contentview=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,JuanDiegojuandieg...@gmail.com wrote: Thanks. One more thing, I am doing this inside a joomla so those divs are inside a table inside thecontent 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,JuanDiegojuandieg...@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,JuanDiegojuandieg...@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
[Proto-Scripty] Re: Events not working as expected in opera, ie or any other browser except firefox
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 lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/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_contentview=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,JuanDiegojuandieg...@gmail.com wrote: Thanks. One more thing, I am doing this inside a joomla so those divs are inside a table inside thecontent 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
[Proto-Scripty] Re: Events not working as expected in opera, ie or any other browser except firefox
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 lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/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_contentview=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,JuanDiegojuandieg...@gmail.com wrote: Thanks. One more thing, I am doing this inside a joomla so those divs are inside a table inside thecontent 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
[Proto-Scripty] Re: Events not working as expected in opera, ie or any other browser except firefox
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 lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/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_contentview=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,JuanDiegojuandieg...@gmail.com wrote: Thanks. One more thing, I am doing this inside a joomla so those divs are inside a table inside thecontent 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
[Proto-Scripty] Re: Events not working as expected in opera, ie or any other browser except firefox
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, Juan Diego 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, Juan Diego 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, lista_izq and lista_der, with a list inside list_izq div class=lista_izq ul lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/div So when ever the mouse is over the text1 or text2. The hidden text appears on the second . I use firefox so I did all the testing there. It worked but when i tested on opera, IE, and konqueror it didnt. It is really anoying tracing bugs in other browsers without firebug. Anyhow here is my code for each node Event.observe(titulo, 'mouseover', function(e) { reemplazarX(e); }); Event.observe(titulo, 'mouseout', function(e) { borrar(e); }); and this my functions function reemplazarX(e){ alert(e); alert(e.element); alert(e.element()); var element = e.element(); alert(s); var e2 =element.getOffsetParent(element); alert(t); //e2.childElements()[2].setStyle('backgroundColor', blue); alert(element); alert(xx); e2.childElements()[2].setStyle({ backgroundColor: '#020506', opacity: 1.0, borderLeft:'1px #FFF solid' }); e2.childElements()[2].innerHTML= element.next().innerHTML; } function borrar(e,lista_der){ var element = e.element(); var e2 =element.getOffsetParent(element); e2.childElements()[2].innerHTML= ; e2.childElements()[2].setStyle({ backgroundColor: '#000', opacity: 0.0 }); } I did all those Trace to narrow down the problem and it comes down to e.element. In opera it returns undefine with e.element and it dies when i use e.element(). Like if the function didnt. Exists. I assing each function with to titulo=lista_izq[j].childElements()[0]; with a FOR loop. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Events not working as expected in opera, ie or any other browser except firefox
Thanks. One more thing, I am doing this inside a joomla so those divs are inside a table inside thecontent 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: Hi Juan, 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 Juan Diego wrote: 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, Juan Diego 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, Juan Diego 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, lista_izq and lista_der, with a list inside list_izq div class=lista_izq ul lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/div So when ever the mouse is over the text1 or text2. The hidden text appears on the second . I use firefox so I did all the testing there. It worked but when i tested on opera, IE, and konqueror it didnt. It is really anoying tracing bugs in other browsers without firebug. Anyhow here is my code for each node Event.observe(titulo, 'mouseover', function(e) { reemplazarX(e); }); Event.observe(titulo, 'mouseout', function(e) { borrar(e); }); and this my functions function reemplazarX(e){ alert(e); alert(e.element); alert(e.element()); var element = e.element(); alert(s); var e2 =element.getOffsetParent(element); alert(t); //e2.childElements()[2].setStyle('backgroundColor', blue); alert(element); alert(xx); e2.childElements()[2].setStyle({ backgroundColor: '#020506', opacity: 1.0, borderLeft:'1px #FFF solid' }); e2.childElements()[2].innerHTML= element.next().innerHTML; } function borrar(e,lista_der){ var element = e.element(); var e2 =element.getOffsetParent(element); e2.childElements()[2].innerHTML= ; e2.childElements()[2].setStyle({ backgroundColor: '#000', opacity: 0.0 }); } I did all those Trace to narrow down the problem
[Proto-Scripty] Events not working as expected in opera, ie or any other browser except firefox
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, lista_izq and lista_der, with a list inside list_izq div class=lista_izq ul lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/div So when ever the mouse is over the text1 or text2. The hidden text appears on the second . I use firefox so I did all the testing there. It worked but when i tested on opera, IE, and konqueror it didnt. It is really anoying tracing bugs in other browsers without firebug. Anyhow here is my code for each node Event.observe(titulo, 'mouseover', function(e) { reemplazarX(e); }); Event.observe(titulo, 'mouseout', function(e) { borrar(e); }); and this my functions function reemplazarX(e){ alert(e); alert(e.element); alert(e.element()); var element = e.element(); alert(s); var e2 =element.getOffsetParent(element); alert(t); //e2.childElements()[2].setStyle('backgroundColor', blue); alert(element); alert(xx); e2.childElements()[2].setStyle({ backgroundColor: '#020506', opacity: 1.0, borderLeft:'1px #FFF solid' }); e2.childElements()[2].innerHTML= element.next().innerHTML; } function borrar(e,lista_der){ var element = e.element(); var e2 =element.getOffsetParent(element); e2.childElements()[2].innerHTML= ; e2.childElements()[2].setStyle({ backgroundColor: '#000', opacity: 0.0 }); } I did all those Trace to narrow down the problem and it comes down to e.element. In opera it returns undefine with e.element and it dies when i use e.element(). Like if the function didnt. Exists. I assing each function with to titulo=lista_izq[j].childElements()[0]; with a FOR loop. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Events not working as expected in opera, ie or any other browser except firefox
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, Juan Diego 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, lista_izq and lista_der, with a list inside list_izq div class=lista_izq ul lidiv class=texttext1/div div class=hidden_texthidden1/div /li lidiv class=texttext2/div div class=hidden_texthidden2/div /li /ul /div div class=lista_dernbsp/div So when ever the mouse is over the text1 or text2. The hidden text appears on the second . I use firefox so I did all the testing there. It worked but when i tested on opera, IE, and konqueror it didnt. It is really anoying tracing bugs in other browsers without firebug. Anyhow here is my code for each node Event.observe(titulo, 'mouseover', function(e) { reemplazarX(e); }); Event.observe(titulo, 'mouseout', function(e) { borrar(e); }); and this my functions function reemplazarX(e){ alert(e); alert(e.element); alert(e.element()); var element = e.element(); alert(s); var e2 =element.getOffsetParent(element); alert(t); //e2.childElements()[2].setStyle('backgroundColor', blue); alert(element); alert(xx); e2.childElements()[2].setStyle({ backgroundColor: '#020506', opacity: 1.0, borderLeft:'1px #FFF solid' }); e2.childElements()[2].innerHTML= element.next().innerHTML; } function borrar(e,lista_der){ var element = e.element(); var e2 =element.getOffsetParent(element); e2.childElements()[2].innerHTML= ; e2.childElements()[2].setStyle({ backgroundColor: '#000', opacity: 0.0 }); } I did all those Trace to narrow down the problem and it comes down to e.element. In opera it returns undefine with e.element and it dies when i use e.element(). Like if the function didnt. Exists. I assing each function with to titulo=lista_izq[j].childElements()[0]; with a FOR loop. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Proto-Scripty] writing unintrusive javascript with prototype
Hi, in the last months i have been using the prototype framework. But at some points i havent been able to write unintrusive code(separating javascript from the pages). Here is an example of what i am trying to do. Example: javascript function onBlurObject(){ var url = pag/newPage.php; var pars = txtCedula=+$F('txtCedula'); var myAjax = new Ajax.Updater( 'charging', url, { method: post, parameters: pars, evalScripts: true }); } Event.observe(window, 'load', function() { Event.observe('txtCedula', 'blur', onBlurObject); }); Until know it is unintrusive. But the thing is that in the page newPage.php i have some fields that i should react to certain events like the onblur or change. What is the correct way create another event.observe('fieldNewPage','blur',function), cause i believe writing any javascript on newPage.php wouldnt be correct or is it? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---