Hi Eric,

After writting the last post, a light bright in my mind!
Why could it be impossible?? Stupid ....

The very big difficulties is to be able to select the good class to
change it's value.
But look at this small test. It will change opacity from 1 to 0 to all
black elements when clicking the button:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">

<head>

    <title>o0O TEST O0o</title>

    <style type="text/css">





.setUpTransition{

  width:100px;

  height:75px;

  background-color:#000000;

  opacity:1;
  margin:3px;
  display:inline-block;

}

.contener{width:100%;height:100%;background-color:yellow;opacity:1;}



    </style>

    <script src="prototype.js" type="text/javascript"></script>

    <script src="scriptaculous.js" type="text/javascript"></script>





</head>

<body>



<div id="contener" class="contener">

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

  <div class="setUpTransition"></div>

</div>
<button onclick="startEffect();">click</button>

<script>
var startTime=null;
var duration=5000;
launchEffect=function(){
  var now=new Date().getTime();
  var elapse=now-startTime;
  if(elapse>duration){
    changeStyle(0);
   return;
  }
  elapse=1-(elapse/duration);
  changeStyle(elapse);
  launchEffect.delay(0.03);
}
startEffect=function(){
  startTime=new Date().getTime();
  launchEffect.delay(0.03);
}
changeStyle=function(_opacity){
  var mysheet=document.styleSheets[0];
  var firstrule=mysheet.cssRules? mysheet.cssRules[0]: mysheet.rules
[0]
  if (firstrule.style.opacity) firstrule.style.opacity=_opacity;
}

</script>

</body>

</html>

and I think it's now what you need!!
sorry ...

--
david



On 11 fév, 16:34, david <david.brill...@gmail.com> wrote:
> Hi Eric,
>
> To be more precise regarding you answer in the second post, there is
> actually no way to modify a CSS property and do a transition on a
> large number of elements. But things are changing, and there is webkit
> pushing the limit on web animation (or transition).
>
> the answer given from bminihan and me are effectivelly how we handle
> this kind of problems actually as there is not a lot of possibilities.
> I should have say that at the previous post !!
>
> --
> david
>
> On 11 fév, 15:36, ColinFine <colin.f...@pace.com> wrote:
>
> > On Feb 9, 2:49 pm, Eric <lefauv...@gmail.com> wrote:
>
> > > Hi,
>
> > > I apologize if my question is stupid (and it should be since I cannot
> > > find any reference to this idea anywhere) but I was wandering if it
> > > would be possible to use an effect on a CSS style definition instead
> > > of a DOM object.
>
> > The people who have answered seem to have ignored your question, and
> > told you what they think you should do instead.
>
> > I think your suggestion is an interesting one: I don't see why it
> > shouldn't work, but when I've looked at manipulating the stylesheet
> > from JS, it looked rather tricky to me (and different on IE). I don't
> > know of any attempts to automate it in a library, or use it for
> > dynamic effects. Whether it would actually perform any better than
> > changing the class I don't know: it depends on how Browsers behave
> > when you change styles in their stylesheet.
>
> > Seehttp://www.javascriptkit.com/dhtmltutors/externalcss.shtmlfor
> > some information on doing it.
>
> > Colin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to