SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery: Change part of background CSS

    I'm making a realtime css editor using jQuery and it works just perfect except for one thing...

    When I use solid backgrounds it works fine like this:
    Code JavaScript:
    jQuery("#boxtitleback").attachColorPicker();
    jQuery("#boxtitleback").change(function() {jQuery('#boxtitle h1').css("background-color",jQuery("#boxtitleback").getValue())});

    But what if I want to change one color of an -webkit-gradient???

    How do i do that?
    background:-webkit-gradient(linear,0% 0,0% 100%,from(#333),to(#5e5e65));

    Thanks in advance ;-)

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by jmansa View Post
    But what if I want to change one color of an -webkit-gradient???
    Have you tried taking a look at how others do it?
    http://gradients.glrzad.com/
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •