Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Darryl Godden 145 posts 197 karma points
    Jul 01, 2010 @ 12:02
    Darryl Godden
    0

    Using the Color Picker to change panel/div background

    Hi all,

    I would like to use the color picker to change the background color of a asp:Panel or a div (either can be used), this is so the user can change the background colour of some content.

    Any idea how I could about this? I thought retrieving the field value in the Page_Init event and setting the BackColor in there?

    Thanks.

  • Rich Green 2246 posts 4008 karma points
    Jul 01, 2010 @ 12:11
    Rich Green
    0

    Personally I would use JQuery (either the color or animate plugin?) to set the color, then you can just us a macro to write out the jQuery script which includes the color from the picker.

    Rich

     

  • Darryl Godden 145 posts 197 karma points
    Jul 01, 2010 @ 12:12
    Darryl Godden
    0

    Ok, could you provide a small example? I've never used jQuery to write out a macro?

  • Rich Green 2246 posts 4008 karma points
    Jul 01, 2010 @ 12:28
    Rich Green
    0

    Actually you wouldn't need JQuery at all if you were only setting the color when the page loads. 

    Something like the below should work.

    <body bgcolor="<umbraco:Item field="color" runat="server"/>">
    
    </body>

     

  • Darryl Godden 145 posts 197 karma points
    Jul 01, 2010 @ 15:02
    Darryl Godden
    0

    Thanks for setting me in the right direction:

     

    <div id="feature-info" style='background-color:#<umbraco:Item field="shopHighlightCopyBG" runat="server"></umbraco:Item>'>
Please Sign in or register to post replies

Write your reply to:

Draft