Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    gradient background

    Hi

    Is there a function to do gradient display?

    thanks!

    #2
    You use image files to achieve this - see the Skinning Guide for instructions on how you can incorporate media into various components.

    Note that CSS-based gradient effects exist on some browsers, but it is not yet broadly supported enough. When it is, we'll support it and have docs on which browsers it works with.

    Comment


      #3
      Hi,

      Could you please provide an update about this?
      By now, most browser support gradient backgrounds in some form or other.

      (Works: FF >= 3.6, Chrome, Safari, IE >= 7 (with some DirectX magic))

      It would be nice if there was a wrapper for the various browser quirks and work-arounds required to do this.

      (The image-file based approach does not work when the parameters change on the fly.)

      Thank you:

      Csillag

      Comment


        #4
        We will be providing skins that make use of these features via CSS where available. We do not yet plan a feature to programmaticaly generate CSS for a gradient (although this does exist for vector shapes in the Drawing Module in 3.x).

        Comment


          #5
          Code:
           I tried use CSS..
          It is working in firefox. but not in IE.
          See the Example
                 .roundStyle {
          	           border-radius: 6px;
          	}

          Comment


            #6
            To apply a gradient background to something like an HLayout, simply specify a CSS class and do not specify a backgroundImage property. Then, in your CSS, add something similar to the following properties to your CSS class, which creates a multi-step black-to-white gradient:

            Code:
            background: #4c4c4c; /* Old browsers */
            background: -moz-linear-gradient(top,  #4c4c4c 0%, #595959 12%, #666666 25%, #474747 39%, #2c2c2c 50%, #000000 51%, #111111 60%, #2b2b2b 76%, #1c1c1c 91%, #131313 100%); /* FF3.6+ */
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4c4c4c), color-stop(12%,#595959), color-stop(25%,#666666), color-stop(39%,#474747), color-stop(50%,#2c2c2c), color-stop(51%,#000000), color-stop(60%,#111111), color-stop(76%,#2b2b2b), color-stop(91%,#1c1c1c), color-stop(100%,#131313)); /* Chrome,Safari4+ */
            background: -webkit-linear-gradient(top,  #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* Chrome10+,Safari5.1+ */
            background: -o-linear-gradient(top,  #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* Opera 11.10+ */
            background: -ms-linear-gradient(top,  #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* IE10+ */
            background: linear-gradient(top,  #4c4c4c 0%,#595959 12%,#666666 25%,#474747 39%,#2c2c2c 50%,#000000 51%,#111111 60%,#2b2b2b 76%,#1c1c1c 91%,#131313 100%); /* W3C */
            filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#131313',GradientType=0 ); /* IE6-9 */
            Note that IE only supports 2-step gradients as of version 9. I haven't tested this on v10. The other browsers support multi-step gradients and you can see each of those steps listed above in color/distance pairs.

            HTH,
            Sol

            Comment

            Working...
            X