PDA

View Full Version : Display text with different colors next to buttons [swiss army slideshow]



Turin
01-06-2011, 10:24 PM
1) Script Title: Swiss army slideshow

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/swissarmy/index.htm

3) Describe problem: Great script! Works perfect and look really nice. I do have two little problems though when adjusting the script a bit.

1. I would like to display the description of the image next to the previous and next buttons (who are located above the image). I tried it with the swiss_2.js, but then i get a blank page. Looks like swiss_2.js does not work with me :S Is there another way to do this?

2. I would like to give de descriptions of the images color and change the font size, type. I can do this with basic CSS, but the thing is, I want different words different color and size.
Example description: ´Section = Art - Fountain by M. Duchamp´. I would like ´Section=Art´ to be grey in a smaller font size in times new roman and ´Fountain Duchamp´ black, bigger font in Arial. Is this possible?

Thanks very much in advance!

jscheuer1
01-07-2011, 06:37 AM
Using swiss_2.js is the way to go. Give me a link to the page that you have with swiss_2 and we'll figure out what the problem is.

Turin
01-07-2011, 04:38 PM
I got swiss_2.js working! A certain table in my CSS was to small so the script did not fit where I wanted it to.

I figured out how to get the text next to the buttons on top. But I can´t manage different text colors and sizes in the description text. Neither can I center the image in the middle of the page (but I thought that question was asked before here, so I´ll be browsing the forum).

Unfortunally I cannot post a link to the slideshow, since it is not online yet. Where I am right now I do not have internet acces, exept for shady internet cafe´s where I am at now.

Turin
01-07-2011, 07:21 PM
Huray! Got almost everything working the way I like it. This script is great! Could anyone please help me out with the different text colors though? Whatever I do, it doesnt seem to work.

jscheuer1
01-08-2011, 07:06 AM
That may require some custom code. However, if you aren't using the description as title or alt (do not have either of these set):


slides#.use_alt=1; //use for descriptions as images alt attributes
slides#.use_title=1; //use for descriptions as images title attributes

Instead of like:


slides2[0] = ["photo6.jpg", "Section = Art - Fountain by M. Duchamp"];

You can put regular markup in the description field and use style in a stylesheet to style it, example:


slides2[0] = ["photo6.jpg", '<span class="desc_sec">Section = Art</span> - <span class="desc_title_artist">Fountain</span> by <span class="desc_title_artist">M. Duchamp</span>'];

Notice that the delimiters for the description are now single quotes (') so that double quotes (") may be used inside it.

Then in your stylesheet you can have like:


.desc_sec {
font: normal smaller 'times new roman', serif;
color: gray;
}
.desc_title_artist {
font: bold 100% arial, sans-serif;
color: black;
}

Turin
01-08-2011, 08:15 PM
That did the job! As soon as the slideshow is online, I´ll post a link here. Thanks very much for the help: