Results 1 to 6 of 6

Thread: How to style captions?

  1. #1
    Join Date
    Oct 2009
    Posts
    20
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default How to style captions?

    1) Script Title: fadeslideshow.js Ultimate Fade-in slideshow (v2.4)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem:

    Hi :O)

    How do i style my captions? I am using the Peekaboo effect. I have scoured the forums with search terms like "captions + styling", "captions + fonts", "captions + css", but to no avail.

    There wasn't a css file that accompanied the script (from what i can remember). So i tried targeting the text in the caption by using #fadeshow1 (the ID of my slideshow) within my own css, but it didn't work.

    Any guidance would be much appreciated. I've used this slideshow several times and this is the first time i'm wanting to utilize the captions.

    kindly,

    ccesca

  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

    There is no stylesheet, the script assumes for simplicity's sake a one-size-fits-all approach in many of its stylings. However, one can override any of the scripted styles. The selectors are .descpanelbg for the description's background layer and .descpanelfg for the description's foreground layer, for example:

    Code:
    <style type="text/css">
    .descpanelbg {
    	background-color: orange !important;
    }
    .descpanelfg {
    	color: black !important;
    }
    </style>
    That would give you black descriptions on a faded orange background. Or you could do:

    Code:
    <style type="text/css">
    .descpanelfg {
    	color: yellow !important;
    	font-size: 110% !important;
    	font-family: comic sans ms, momospace !important;
    }
    </style>
    I think you get the idea. Just be sure to use the !important keyword as shown to override any conflicting scripted styles for these elements.
    - John
    ________________________

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

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    ccesca (11-06-2011)

  4. #3
    Join Date
    Oct 2009
    Posts
    20
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Excellent! Thank you, it worked!

    Follow-up question....

    Can I somehow include HTML in the captions... or is there any way to style certain words wthin the captions differently (i.e. headers and paragraphs), and make the background color for each image's caption different? Or perhaps include an image within the caption?

    I understand this may be asking too much, but for all i know it's possible...?

    ccesca

  5. #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

    All that can probably be done. To include HTML or an image as HTML in a description, use single quotes to delimit the caption, example:

    Code:
    imagearray: [
    		["http://i26.tinypic.com/11l7ls0.jpg", "", "", '<span style="font-weight:bold;">Nothing</span> beats relaxing next to the pool when the weather is hot.'],
    		["http:/ . . .
    You can include an image in the same way, just use an img tag. It's probably best to supply the width and height attributes to make it easier for the script to lay it out in the description area.

    As for changing the background color for each image, that would be a little more complicated. I'm not sure when to change it. The script has an onslide function, but depending upon when the description is revealed, that might be too late. I have an add on that provides an onbeforeslide function, but that may be too early. What sort of descreveal are you using? Unless we made up a set of overriding styles and switched out additional classes on the background panel we could no longer use overriding style in a stylesheet for the .descpanelbg selector, it would override anything we try to do in the script to change it.

    If you don't mind the background color being 100% opaque, you could try making a div within the description field for each imagearray entry that includes the background color:

    Code:
    imagearray: [
    		["some.jpg", "", "", '<div style="background-color:blue;"><span style="font-weight:bold;">Nothing</span> beats relaxing.</div>'],
    		["http:/ . . .
    You might have to specify height and/or width at 100%, but perhaps not.
    - John
    ________________________

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

  6. #5
    Join Date
    Oct 2009
    Posts
    20
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thank so much for your helpful and detailed reply....

    I haven't had a chance to experiment with these new ideas, will hopefully get the opportunity to do so over the weekend and will let you know how i get on.

    Thanks again for replying, I'm very grateful.

  7. #6
    Join Date
    Oct 2009
    Posts
    20
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Wow... it's me here again, with the exact same question, and i just realized I was the OP!! (almost exactly one year later... well, not quite,... but kind of)

    Hahaha!!

    Thanks again

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
  •