Loading ...
Sorry, an error occurred while loading the content.

ColorAnim and body background color

Expand Messages
  • tistitch
    hello, i just wonder if it is possible to change the body background color and color text but i can t... is there a way? i tried this : var attributes = {
    Message 1 of 3 , Sep 29, 2006
    • 0 Attachment
      hello, i just wonder if it is possible to change the body background
      color and color text but i can't...

      is there a way?

      i tried this :

      var attributes = {
      color: { to: '#FFFF00' },
      backgroundColor: { to: '#ff0006' },
      borderTopColor: { to: '#42ff00' },
      borderRightColor: { to: '#42ff00' },
      borderBottomColor: { to: '#42ff00' },
      borderLeftColor: { to: '#42ff00' }
      };

      var anim = new YAHOO.util.ColorAnim(body, attributes);
      YAHOO.util.Event.on(document, 'click', anim.animate, anim, true);
      };

      YAHOO.util.Event.onAvailable(body, YAHOO.example.init2);



      thanks by advance
    • Eric Miraglia
      tistitch, In playing around with this just a bit, I m finding that I need to specify a from value for backgroundColor on the body element in order for the
      Message 2 of 3 , Oct 1, 2006
      • 0 Attachment
        tistitch,

        In playing around with this just a bit, I'm finding that I need to specify a "from" value for backgroundColor on the body element in order for the animation to work.  We'll look into this more deeply, but you might want to try being explicit about the from value on backgroundColor and see if that solves your problem.  Here's some code that works for me:

        var init = function() {

        var attributes = {
        color: {
        to: '#ff0000'
        },
        backgroundColor: {
        from: '#ffffff',
        to: '#000000'
        }
        };
        var anim = new YAHOO.util.ColorAnim(YAHOO.util.Dom.get(document.body), attributes);
        YAHOO.util.Event.on(document, 'click', anim.animate, anim, true);
        }
        YAHOO.util.Event.on(window, "load", init);

        Regards,
        Eric


        ______________________________________________
        Eric Miraglia
        Yahoo! Presentation Platform Engineering



        On Sep 29, 2006, at 8:29 AM, tistitch wrote:

        hello, i just wonder if it is possible to change the body background
        color and color text but i can't...

        is there a way?

        i tried this :

        var attributes = {
        color: { to: '#FFFF00' },
        backgroundColor: { to: '#ff0006' },
        borderTopColor: { to: '#42ff00' },
        borderRightColor: { to: '#42ff00' },
        borderBottomColor: { to: '#42ff00' },
        borderLeftColor: { to: '#42ff00' }
        };

        var anim = new YAHOO.util.ColorAnim(body, attributes);
        YAHOO.util.Event.on(document, 'click', anim.animate, anim, true);
        };

        YAHOO.util.Event.onAvailable(body, YAHOO.example.init2);

        thanks by advance


      • tistitch
        Eric, Thank you very much! it works fine with from in the backgroundColor! Really nice! My code : var attributes = { color: { to: #FFFF00 }, backgroundColor:
        Message 3 of 3 , Oct 2, 2006
        • 0 Attachment
          Eric,

          Thank you very much! it works fine with from in the backgroundColor!
          Really nice!

          My code :

          var attributes = {
          color: { to: '#FFFF00' },
          backgroundColor: {from: '#ffffff', to: '#ff0006' },
          borderTopColor: { to: '#42ff00' },
          borderRightColor: { to: '#42ff00' },
          borderBottomColor: { to: '#42ff00' },
          borderLeftColor: { to: '#42ff00' }
          };

          var anim = new
          YAHOO.util.ColorAnim(YAHOO.util.Dom.get(document.body), attributes);
          YAHOO.util.Event.on(document, 'click', anim.animate, anim, true);
          };


          Best Regards,

          Alex


          --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
          >
          > tistitch,
          >
          > In playing around with this just a bit, I'm finding that I need to
          > specify a "from" value for backgroundColor on the body element in
          > order for the animation to work. We'll look into this more deeply,
          > but you might want to try being explicit about the from value on
          > backgroundColor and see if that solves your problem. Here's some
          > code that works for me:
          >
          > var init = function() {
          >
          > var attributes = {
          > color: {
          > to: '#ff0000'
          > },
          > backgroundColor: {
          > from: '#ffffff',
          > to: '#000000'
          > }
          > };
          >
          > var anim = new YAHOO.util.ColorAnim(YAHOO.util.Dom.get
          > (document.body), attributes);
          > YAHOO.util.Event.on(document, 'click', anim.animate, anim, true);
          > }
          > YAHOO.util.Event.on(window, "load", init);
          >
          > Regards,
          > Eric
          >
          >
          > ______________________________________________
          > Eric Miraglia
          > Yahoo! Presentation Platform Engineering
          >
          >
          >
          > On Sep 29, 2006, at 8:29 AM, tistitch wrote:
          >
          > > hello, i just wonder if it is possible to change the body background
          > > color and color text but i can't...
          > >
          > > is there a way?
          > >
          > > i tried this :
          > >
          > > var attributes = {
          > > color: { to: '#FFFF00' },
          > > backgroundColor: { to: '#ff0006' },
          > > borderTopColor: { to: '#42ff00' },
          > > borderRightColor: { to: '#42ff00' },
          > > borderBottomColor: { to: '#42ff00' },
          > > borderLeftColor: { to: '#42ff00' }
          > > };
          > >
          > > var anim = new YAHOO.util.ColorAnim(body, attributes);
          > > YAHOO.util.Event.on(document, 'click', anim.animate, anim, true);
          > > };
          > >
          > > YAHOO.util.Event.onAvailable(body, YAHOO.example.init2);
          > >
          > > thanks by advance
          > >
          > >
          > >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.