Results 1 to 4 of 4

Thread: transparent/ no bg on fadeinslideshow?

  1. #1
    Join Date
    Feb 2008
    Posts
    83
    Thanks
    26
    Thanked 1 Time in 1 Post

    Question transparent/ no bg on fadeinslideshow?

    RE: http://www.dynamicdrive.com/dynamici...nslideshow.htm

    I want this to be transparent/ no bg color. It's ruining my rounded corners png images and if i remove the code it won't work:

    var fadebgcolor="#FFFF99"

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, you need a background with this script, otherwise there will be bleed through in addition to the fading effect from the various images in the show as they change and transform.

    Like if you did:

    Code:
    var fadebgcolor="transparent"
    You would see what I'm talking about.

    Now I'm not sure how you have your corners set up, but you can use a background image instead of a background.

    There are two places in the script where the var fadebgcolor is used. They both look like so:

    Code:
    background-color:'+fadebgcolor+'
    and they are both in one very long line, this one:

    Code:
    document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
    If you change them both to:

    Code:
    background:'+fadebgcolor+'
    Then you can use any valid background style for the var fadebgcolor, like:

    Code:
    var fadebgcolor="#fff url(some.png)"
    You can also include any of the various positioning values that may be employed with a background property that uses an image. Often people use the same background image as the one that is behind the slide show, and use the positioning values to line it up with that existing background image.

    Alternatively, if you just want your images in a frame, you can put a frame around the outside of the slide show, or make up a mask and apply it to each of the images.

    If you want more help:

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2008
    Posts
    83
    Thanks
    26
    Thanked 1 Time in 1 Post

    Default Thanks!

    Here's a link to the site: http://www.clubrazzberry.com/car-loan1/

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I can't seem to get it pixel perfect, but if you use:

    Code:
    var fadebgcolor="#FFFF99 url(http://www.clubrazzberry.com/car-loan1/images/bg1.gif)"
    and change this line:

    Code:
    document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
    to:

    Code:
    document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background:'+fadebgcolor+'"></div></div>')
    It will work out pretty well.

    After that, you can try fine tuning the background-position in a stylesheet in the head of the page, one entry for each show, ex (worked in FF at least full screen in my browser):

    Code:
    <style type="text/css">
    #master0 div {
    background-position:0 1px !important;
    }
    #master1 div {
    background-position:1 -1px !important;
    }
    #master2 div {
    background-position:0 1px !important;
    }
    </style>
    But this seemed to vary by browser and by window size, and I lost patience with it. For more on using background-position see:

    http://www.eskimo.com/~bloo/indexdot...bg/bgposit.htm

    or your favorite css style reference.
    Last edited by jscheuer1; 05-13-2008 at 03:12 PM. Reason: add info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •