Ok, I''ve used this before, but I can''t seem to make it work with an array of objects. How do I make ButtonHover use the object applied? <script language="javascript" type="text/javascript"> function ButtonHover($s){ $s.style.color = ''#FF0000''; $s.style.fontSize = ''18px''; } function ButtonOut($s){ $s.style.color = ''#FF0000''; $s.style.fontSize = ''18px''; } </script> <div class="toplinks" style="width: 100%; font-size: 14px; font-weight: bold; border-bottom: 1px solid #000000; background-color: #FFFFFF;"> <a href="http://sharepoint" id="toplink1" class="toplinks_links">Home</a> <a href="/rm5_reporting.php"'' class="toplinks_links" id="toplink2">RM5 Reporting</a> <a href="/form_menu.php"'' class="toplinks_links" id="toplink3">Forms</a> </div> <script language="javascript" type="text/javascript"> $aTD = document.getElementsByClassName(''toplinks_links''); for($i = 0; $i < $aTD.length; $i ++){ Event.observe($aTD[$i], ''mouseover'', function(){ ButtonHover(this); }) } </script> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Here is how to do it without using bind, which I think is preferable in this case since, if you do have to cleanup, using Event.stopObserving would be easier this way. $aTD = document.getElementsByClassName(''toplinks_links''); $aTD.each(function(el){ Event.observe(el, ''mouseover'', ButtonHover); }); function ButtonHover(event){ $s = Event.element(event); $s.style.color = ''#FF0000''; $s.style.fontSize = ''18px''; } Colin Keith wrote:> Ok, I''ve used this before, but I can''t seem to make it work with an > array of objects. How do I make ButtonHover use the object applied? > > <script language="javascript" type="text/javascript"> > function ButtonHover($s){ > > $s.style.color = ''#FF0000''; > $s.style.fontSize = ''18px''; > > } > > function ButtonOut($s){ > > $s.style.color = ''#FF0000''; > $s.style.fontSize = ''18px''; > > } > </script> > <div class="toplinks" style="width: 100%; font-size: 14px; > font-weight: bold; border-bottom: 1px solid #000000; background-color: > #FFFFFF;"> > <a href="http://sharepoint" id="toplink1" > class="toplinks_links">Home</a> > <a href="/rm5_reporting.php"'' class="toplinks_links" id="toplink2">RM5 > Reporting</a> > <a href="/form_menu.php"'' class="toplinks_links" > id="toplink3">Forms</a> > </div> > <script language="javascript" type="text/javascript"> > $aTD = document.getElementsByClassName(''toplinks_links''); > > for($i = 0; $i < $aTD.length; $i ++){ > > Event.observe($aTD[$i], ''mouseover'', function(){ > ButtonHover(this); }) > > } > </script> > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Even though I answered your question in the first message, I should point out that this is a perfect candidate for CSS. Javascript in your example is completely unnecessary. a.toplinks_links:hover { color: #FF0000; font-size: 18px; } Colin Keith wrote:> Ok, I''ve used this before, but I can''t seem to make it work with an > array of objects. How do I make ButtonHover use the object applied? > > <script language="javascript" type="text/javascript"> > function ButtonHover($s){ > > $s.style.color = ''#FF0000''; > $s.style.fontSize = ''18px''; > > } > > function ButtonOut($s){ > > $s.style.color = ''#FF0000''; > $s.style.fontSize = ''18px''; > > } > </script> > <div class="toplinks" style="width: 100%; font-size: 14px; > font-weight: bold; border-bottom: 1px solid #000000; background-color: > #FFFFFF;"> > <a href="http://sharepoint" id="toplink1" > class="toplinks_links">Home</a> > <a href="/rm5_reporting.php"'' class="toplinks_links" id="toplink2">RM5 > Reporting</a> > <a href="/form_menu.php"'' class="toplinks_links" > id="toplink3">Forms</a> > </div> > <script language="javascript" type="text/javascript"> > $aTD = document.getElementsByClassName(''toplinks_links''); > > for($i = 0; $i < $aTD.length; $i ++){ > > Event.observe($aTD[$i], ''mouseover'', function(){ > ButtonHover(this); }) > > } > </script> > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Oct-20 06:56 UTC
Re: Event.observe, refer to the object observed
Aside from Colin''s remark on CSS being the only thing you need here (which is true!), there''s no need for bind or anything: you''re just misinterpreting how Event.observe works. Your event handlers will always get passed the event object as a first argument. The portable way to get a reference to the object that triggered the observer is like this: function ButtonHover(e) { var elt = Event.element(e); elt.style... ... } Your "this" argument in your anonymous function wouldn''t work: it uses the value of "this" at the time of definition, not at the time of calling. Even binding it wouldn''t help much anyhow with the code you wrote: it would require using "this." inside your callback, not the first argument. So, in short, read more than half the doc page ;-), and go with the flow whenever possible. And yeah, here, CSS could do the hover/out thing by itself. ''regards, -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
I know this sounds crazy, but the CSS is acting crazy on these pages. The hover only works on some links (it seems like it''s only on non-visited links, if that makes any sense) and I''m having to build a workaround until I can figure out what''s wrong. -----Original Message----- From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Colin Mollenhour Sent: Thursday, October 19, 2006 11:43 PM To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails-spinoffs] Re: Event.observe, refer to the object observed Even though I answered your question in the first message, I should point out that this is a perfect candidate for CSS. Javascript in your example is completely unnecessary. a.toplinks_links:hover { color: #FF0000; font-size: 18px; } Colin Keith wrote:> Ok, I''ve used this before, but I can''t seem to make it work with an > array of objects. How do I make ButtonHover use the object applied? > > <script language="javascript" type="text/javascript"> function > ButtonHover($s){ > > $s.style.color = ''#FF0000''; > $s.style.fontSize = ''18px''; > > } > > function ButtonOut($s){ > > $s.style.color = ''#FF0000''; > $s.style.fontSize = ''18px''; > > } > </script> > <div class="toplinks" style="width: 100%; font-size: 14px; > font-weight: bold; border-bottom: 1px solid #000000; background-color: > #FFFFFF;"> > <a href="http://sharepoint" id="toplink1" > class="toplinks_links">Home</a> > <a href="/rm5_reporting.php"'' class="toplinks_links" > id="toplink2">RM5 Reporting</a> > <a href="/form_menu.php"'' class="toplinks_links" > id="toplink3">Forms</a> > </div> > <script language="javascript" type="text/javascript"> > $aTD = document.getElementsByClassName(''toplinks_links''); > > for($i = 0; $i < $aTD.length; $i ++){ > > Event.observe($aTD[$i], ''mouseover'', function(){ > ButtonHover(this); }) > > } > </script> > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Ok, I when I do it like this, I get target is null or not an object. -----Original Message----- From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Christophe Porteneuve Sent: Friday, October 20, 2006 1:56 AM To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails-spinoffs] Re: Event.observe, refer to the object observed Aside from Colin''s remark on CSS being the only thing you need here (which is true!), there''s no need for bind or anything: you''re just misinterpreting how Event.observe works. Your event handlers will always get passed the event object as a first argument. The portable way to get a reference to the object that triggered the observer is like this: function ButtonHover(e) { var elt = Event.element(e); elt.style... ... } Your "this" argument in your anonymous function wouldn''t work: it uses the value of "this" at the time of definition, not at the time of calling. Even binding it wouldn''t help much anyhow with the code you wrote: it would require using "this." inside your callback, not the first argument. So, in short, read more than half the doc page ;-), and go with the flow whenever possible. And yeah, here, CSS could do the hover/out thing by itself. ''regards, -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Oct-20 11:54 UTC
Re: Event.observe, refer to the object observed
Hey, Keith Davis a écrit :> Ok, I when I do it like this, I get target is null or not an object.What''s your observe call like? ''should be something along the lines of this: function ButtonHover(event) { var elt = Event.element(event); ... } Event.observe(''yourLinkId'', ''mouseover'', ButtonHover); -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Why are we calling a function without ()? When I do that in my HTML or directly from JavaScript, the function is not called. Is it because we are binding? -----Original Message----- From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Christophe Porteneuve Sent: Friday, October 20, 2006 6:55 AM To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails-spinoffs] Re: Event.observe, refer to the object observed Hey, Keith Davis a écrit :> Ok, I when I do it like this, I get target is null or not an object.What''s your observe call like? ''should be something along the lines of this: function ButtonHover(event) { var elt = Event.element(event); ... } Event.observe(''yourLinkId'', ''mouseover'', ButtonHover); -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
He''s not calling the function immediately, just passing it in to be called when the event fires. You were doing the same thing in your first example, only you wrapped it in an anonymous function (called a closure)... the function you passed did not have () on the end if you look closely. On 10/20/06, Keith Davis <laurin1-O8hiI7urADA@public.gmane.org> wrote:> > > Why are we calling a function without ()? When I do that in my HTML or > directly from JavaScript, the function is not called. Is it because we are > binding? > > -----Original Message----- > From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Christophe > Porteneuve > Sent: Friday, October 20, 2006 6:55 AM > To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Subject: [Rails-spinoffs] Re: Event.observe, refer to the object observed > > > Hey, > > Keith Davis a écrit : > > Ok, I when I do it like this, I get target is null or not an object. > > What''s your observe call like? ''should be something along the lines of > this: > > function ButtonHover(event) { > var elt = Event.element(event); > ... > } > > Event.observe(''yourLinkId'', ''mouseover'', ButtonHover); > > -- > Christophe Porteneuve aka TDD > tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > > > >-- Ryan Gahl Application Development Consultant Athena Group, Inc. Inquire: 1-920-955-1457 Blog: http://www.someElement.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
That''s an indication the cascade of your style sheet is in the wrong order. It sounds like you defined "a.someClass:visited" _after_ you defined "a.someClass:hover" when you really want it to be the other way around. TAG On Oct 20, 2006, at 5:46 AM, Keith Davis wrote:> > I know this sounds crazy, but the CSS is acting crazy on these pages. > The hover only works on some links (it seems like it''s only on non- > visited > links, if that makes any sense) and I''m having to build a > workaround until I > can figure out what''s wrong. > > -----Original Message----- > From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Colin > Mollenhour > Sent: Thursday, October 19, 2006 11:43 PM > To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Subject: [Rails-spinoffs] Re: Event.observe, refer to the object > observed > > > Even though I answered your question in the first message, I should > point > out that this is a perfect candidate for CSS. Javascript in your > example is > completely unnecessary. > > a.toplinks_links:hover { > color: #FF0000; > font-size: 18px; > } > > Colin > > Keith wrote: >> Ok, I''ve used this before, but I can''t seem to make it work with an >> array of objects. How do I make ButtonHover use the object applied? >> >> <script language="javascript" type="text/javascript"> function >> ButtonHover($s){ >> >> $s.style.color = ''#FF0000''; >> $s.style.fontSize = ''18px''; >> >> } >> >> function ButtonOut($s){ >> >> $s.style.color = ''#FF0000''; >> $s.style.fontSize = ''18px''; >> >> } >> </script> >> <div class="toplinks" style="width: 100%; font-size: 14px; >> font-weight: bold; border-bottom: 1px solid #000000; background- >> color: >> #FFFFFF;"> >> <a href="http://sharepoint" id="toplink1" >> class="toplinks_links">Home</a> >> <a href="/rm5_reporting.php"'' class="toplinks_links" >> id="toplink2">RM5 Reporting</a> >> <a href="/form_menu.php"'' class="toplinks_links" >> id="toplink3">Forms</a> >> </div> >> <script language="javascript" type="text/javascript"> >> $aTD = document.getElementsByClassName(''toplinks_links''); >> >> for($i = 0; $i < $aTD.length; $i ++){ >> >> Event.observe($aTD[$i], ''mouseover'', function(){ >> ButtonHover(this); }) >> >> } >> </script> >> >> >>> >> >> > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
I''d check for tags that aren''t being properly closed as well. On 10/20/06, Keith Davis <laurin1-O8hiI7urADA@public.gmane.org> wrote:> > > I know this sounds crazy, but the CSS is acting crazy on these pages. > The hover only works on some links (it seems like it''s only on non-visited > links, if that makes any sense) and I''m having to build a workaround until > I > can figure out what''s wrong. > > -----Original Message----- > From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Colin > Mollenhour > Sent: Thursday, October 19, 2006 11:43 PM > To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Subject: [Rails-spinoffs] Re: Event.observe, refer to the object observed > > > Even though I answered your question in the first message, I should point > out that this is a perfect candidate for CSS. Javascript in your example > is > completely unnecessary. > > a.toplinks_links:hover { > color: #FF0000; > font-size: 18px; > } > > Colin > > Keith wrote: > > Ok, I''ve used this before, but I can''t seem to make it work with an > > array of objects. How do I make ButtonHover use the object applied? > > > > <script language="javascript" type="text/javascript"> function > > ButtonHover($s){ > > > > $s.style.color = ''#FF0000''; > > $s.style.fontSize = ''18px''; > > > > } > > > > function ButtonOut($s){ > > > > $s.style.color = ''#FF0000''; > > $s.style.fontSize = ''18px''; > > > > } > > </script> > > <div class="toplinks" style="width: 100%; font-size: 14px; > > font-weight: bold; border-bottom: 1px solid #000000; background-color: > > #FFFFFF;"> > > <a href="http://sharepoint" id="toplink1" > > class="toplinks_links">Home</a> > > <a href="/rm5_reporting.php"'' class="toplinks_links" > > id="toplink2">RM5 Reporting</a> > > <a href="/form_menu.php"'' class="toplinks_links" > > id="toplink3">Forms</a> > > </div> > > <script language="javascript" type="text/javascript"> > > $aTD = document.getElementsByClassName(''toplinks_links''); > > > > for($i = 0; $i < $aTD.length; $i ++){ > > > > Event.observe($aTD[$i], ''mouseover'', function(){ > > ButtonHover(this); }) > > > > } > > </script> > > > > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
It''s the strangest thing. It''s something wrong with IE on this PC. The links work fine on all other machines. _____ From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Sonny Savage Sent: Friday, October 20, 2006 8:09 PM To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails-spinoffs] Re: Event.observe, refer to the object observed I''d check for tags that aren''t being properly closed as well. On 10/20/06, Keith Davis <laurin1-O8hiI7urADA@public.gmane.org> wrote: I know this sounds crazy, but the CSS is acting crazy on these pages. The hover only works on some links (it seems like it''s only on non-visited links, if that makes any sense) and I''m having to build a workaround until I can figure out what''s wrong. -----Original Message----- From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Colin Mollenhour Sent: Thursday, October 19, 2006 11:43 PM To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails-spinoffs] Re: Event.observe, refer to the object observed Even though I answered your question in the first message, I should point out that this is a perfect candidate for CSS. Javascript in your example is completely unnecessary. a.toplinks_links:hover { color: #FF0000; font-size: 18px; } Colin Keith wrote:> Ok, I''ve used this before, but I can''t seem to make it work with an > array of objects. How do I make ButtonHover use the object applied? > > <script language="javascript" type="text/javascript"> function > ButtonHover($s){ > > $s.style.color = ''#FF0000''; > $s.style.fontSize = ''18px''; > > } > > function ButtonOut($s){ > > $s.style.color = ''#FF0000''; > $s.style.fontSize = ''18px''; > > } > </script> > <div class="toplinks" style="width: 100%; font-size: 14px; > font-weight: bold; border-bottom: 1px solid #000000; background-color: > #FFFFFF;"> > <a href="http://sharepoint" id="toplink1" > class="toplinks_links">Home</a> > <a href="/rm5_reporting.php"'' class="toplinks_links" > id="toplink2">RM5 Reporting</a> > <a href="/form_menu.php"'' class="toplinks_links" > id="toplink3">Forms</a> > </div> > <script language="javascript" type="text/javascript"> > $aTD = document.getElementsByClassName(''toplinks_links''); > > for($i = 0; $i < $aTD.length; $i ++){ > > Event.observe($aTD[$i], ''mouseover'', function(){ > ButtonHover(this); }) > > } > </script> > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
Sounds like an issue with a browser plugin (for example web development toolbars, etc) or maybe firewall, ad blocking or av software (for example, Norton stuff is known to inject HTML and JS, which can cause issues). Best, Thomas Am 23.10.2006 um 17:16 schrieb Keith Davis:> It''s the strangest thing. It''s something wrong with IE on this PC. > The links work fine on all other machines. > > From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails- > spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Sonny Savage > Sent: Friday, October 20, 2006 8:09 PM > To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Subject: [Rails-spinoffs] Re: Event.observe, refer to the object > observed > > I''d check for tags that aren''t being properly closed as well. > > On 10/20/06, Keith Davis <laurin1-O8hiI7urADA@public.gmane.org> wrote: > I know this sounds crazy, but the CSS is acting crazy on these pages. > The hover only works on some links (it seems like it''s only on non- > visited > links, if that makes any sense) and I''m having to build a > workaround until I > can figure out what''s wrong. > > -----Original Message----- > From: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Colin > Mollenhour > Sent: Thursday, October 19, 2006 11:43 PM > To: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Subject: [Rails-spinoffs] Re: Event.observe, refer to the object > observed > > > Even though I answered your question in the first message, I should > point > out that this is a perfect candidate for CSS. Javascript in your > example is > completely unnecessary. > > a.toplinks_links:hover { > color: #FF0000; > font-size: 18px; > } > > Colin > > Keith wrote: > > Ok, I''ve used this before, but I can''t seem to make it work with an > > array of objects. How do I make ButtonHover use the object applied? > > > > <script language="javascript" type="text/javascript"> function > > ButtonHover($s){ > > > > $s.style.color = ''#FF0000''; > > $s.style.fontSize = ''18px''; > > > > } > > > > function ButtonOut($s){ > > > > $s.style.color = ''#FF0000''; > > $s.style.fontSize = ''18px''; > > > > } > > </script> > > <div class="toplinks" style="width: 100%; font-size: 14px; > > font-weight: bold; border-bottom: 1px solid #000000; background- > color: > > #FFFFFF;"> > > <a href="http://sharepoint" id="toplink1" > > class="toplinks_links">Home</a> > > <a href="/rm5_reporting.php"'' class="toplinks_links" > > id="toplink2">RM5 Reporting</a> > > <a href="/form_menu.php"'' class="toplinks_links" > > id="toplink3">Forms</a> > > </div> > > <script language="javascript" type="text/javascript"> > > $aTD = document.getElementsByClassName(''toplinks_links''); > > > > for($i = 0; $i < $aTD.length; $i ++){ > > > > Event.observe($aTD[$i], ''mouseover'', function(){ > > ButtonHover(this); }) > > > > } > > </script> > > > > > > > > > > > > > > > > > > > > > >-- Thomas Fuchs wollzelle http://www.wollzelle.com questentier on AIM madrobby on irc.freenode.net http://www.fluxiom.com :: online digital asset management http://script.aculo.us :: Web 2.0 JavaScript http://mir.aculo.us :: Where no web developer has gone before --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---