Re: Dynamic Style Changes with Prototype?

Amiri
Fri, 30 May 2008 20:47:18 -0000

Wow. I figured this out, and figure I should share it: the first
method was correct, excpet I was missing the ''#'' mark before
the
$F(''cp1_Hex''). Go figure.

// Background color preview
Event.addBehavior({
        ''body#colorpicker'': function() {
                Event.observe(document, ''mousemove'',
function(event) {
                        console.log($F(''cp1_Hex''));
                        $(''colorpicker'').setStyle( {
backgroundColor:
''#''+$F(''cp1_Hex'') } );
                });
        }

});




Amiri