Simone Onofri wrote: > Well, > I'm a web designer\developer that following Standards. So I'm updating > my knowledge and interface design capabilities of 2.0 using degradable > javascript via script.aculo.us. In this way, I prefer to not insert > direcly inline js code on (X)HTML page. > > So in most cases I may apply an effect to a series, or array, of > elements with the same classes (think a photogallery). An example to > explain it. > > So I would like to make a photogallery like these: > > <div id="mygallery"> > <a href="..."...><img class="photogallery" alt="Photo 1" ... /></a> > <a href="..."...><img class="photogallery" alt="Photo 2"... /></a> > <a href="..."...><img class="photogallery" alt="Photo 3"... /></a> > <a href="..."...><img class="photogallery" alt="Photo 4" ... /></a> > </div> > > In which when images loads its opacity is set to 50% and on hover or > focus gain the Effect.Appear to gain full 100% opacity. > > On my logic, but I'm not an expert js coder and may be in a wrong way,
Yes, it is. Use CSS opacity and the a:hover pseudo class. No script required and degrades without fuss. <URL: http://www.quirksmode.org/css/opacity.html > When enough users are using IE 7, you'll be able to use :hover on most elements and IE users will see it too. > I would like to use Event.Observer (from prototype) to apply opacity > effect on all images when page loads and to append (but in which > way??? - help!!! :-) If you use CSS, you don't have to wait for onload, it is applied from the moment the stylesheet is loaded. Since that must be in the head, it is before any images. You can get lots of help on CSS at: news:http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets <URL: http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets > -- Fred --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
