Your event object is likely empty.
Instead of
<body onmouseover="mouseover(event)"
onmouseout="mouseout(event)">
Just do a normal body tag, and add the following below your function
declarations:
Event.observe(document, ''mouseover'', mouseover);
There is also a problem with IE recognizing mouse events on either
the window/document (I don''t recall which--if it doesn''t work,
use
the other one).
TAG
On Jul 22, 2007, at 2:31 AM, julio wrote:
>
> Hi,
>
> I have this simple demo code:
>
> <html>
> <head>
> <script src="javascripts/prototype.js"
type="text/javascript"></
> script>
> </head>
> <body onmouseover="mouseover(event)"
onmouseout="mouseout(event)">
> <script>
> var bw, bs, bc;
>
> function mouseover(event) {
>
> var element = Event.element(event);
>
> bw = element.getStyle(''outlineWidth'');
> bs = element.getStyle(''outlineStyle'');
> bc = element.getStyle(''outlineColor'');
>
> element.setStyle({
> outlineWidth: ''1px'',
> outlineStyle: ''dashed'',
> outlineColor: ''#ff0000''
> });
> }
>
> function mouseout(event) {
> var element = Event.element(event);
>
> element.setStyle({
> outlineWidth: bw,
> outlineStyle: bs,
> outlineColor: bc
> });
>
> }
> </script>
> <p>a paragraph: <span id="status">a
span</span></p>
> <h1>a header1</h1>
> <table>
>
<tr><td>A</td><td>B</td><td>C</td></tr>
>
<tr><td>D</td><td>E</td><td>F</td></tr>
>
<tr><td>G</td><td>H</td><td>I</td></tr>
> </table>
> </body>
> </html>
>
> the goal is "outset bordering" a single element when mouse is
over it.
> It works on Firefox 2 but not with IExplorer 7. Have you any idea to
> get it working?
>
> Thanks,
> Julio
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---