PDA

View Full Version : adding hyperlink within Ultimate Fade-in slideshow descriptions



dculture
12-06-2011, 12:46 AM
1) Script Title: Ultimate Fade-in slideshow (v2.4)

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

3) Describe problem: adding hyperlink within descriptions

Hi,
I would like to add a link within the description of the slide. When I include the link tag it disables the script altogether.

Below is an example of what I would like to do in theory. I would appreciate your help with this.

imagearray: [
["images/bh1.jpg", "", "", "<span class='caption-text'>I will get this project done on</span><a href="#" class="links">time</a>"],
["images/bh2.jpg"]
],

jscheuer1
12-06-2011, 02:59 AM
You cannot have like quotes inside a string delimited by those quotes, unless they're escaped. So you can:


imagearray: [
["images/bh1.jpg", "", "", "<span class='caption-text'>I will get this project done on</span><a href=\"#\" class=\"links\">time</a>"],
["images/bh2.jpg"]
],

Or:


imagearray: [
["images/bh1.jpg", "", "", "<span class='caption-text'>I will get this project done on</span><a href='#' class='links'>time</a>"],
["images/bh2.jpg"]
],

Or you could change the delimiting quotes, which would mean that you would have to change or escape those around the class value:


imagearray: [
["images/bh1.jpg", "", "", '<span class="caption-text">I will get this project done on</span><a href="#" class="links">time</a>'],
["images/bh2.jpg"]
],

dculture
12-06-2011, 06:41 AM
Thank you John.

I have another related question about the descriptions. When I try to add a <br /> tag in the description it disables the script and when I add a <p> tag the behavior is inconsistent. What is the best way to add a line break in this scenario?

dculture
12-06-2011, 07:22 AM
Here is an example of the inconsistent <p> behavior for the descriptions.

On this page, slide 1 shows the last line correctly in a paragraph, with no impact on the the slide. http://www.designculturestudio.com/best/website-combo/queensroadhouse.html

On this page, slide 1 shows the line in a paragraph, but the white background does not fill the entire slide. http://www.designculturestudio.com/best/website-combo/habitatfruitvale.html
How do I get it to fill the entire slide? When the <p> is removed the white background fills the entire slide.

jscheuer1
12-06-2011, 07:30 AM
I have no trouble with <br>, perhaps you did something else (a typo?) at the same time that broke the script. I'd stay away from p. It is unpredictable, even in ordinary HTML. The div element seems OK.

However, you needn't necessarily do anything like that. The text will wrap automatically if it needs to in order to fit. As various browsers will display fonts and dimensions slightly differently and the user's settings can make these differences dramatic, this is often the best approach. Using your own line breaks, what looks good in one browser may look very odd in another. You can center, right or left (the default) align and/or justify and/or indent the text.

If you want more help:

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

dculture
12-06-2011, 05:55 PM
Hi John,
I posted the link to the page where the <p> tag is being problematic in my last post. But here it is again.
I even tried a <br>. I should clarify that the tags are working fine, but for some reason it is affecting the white background, it's not filling the entire slide.

The behavior is inconsistent because on this page it works fine
http://www.designculturestudio.com/best/website-combo/queensroadhouse.html
but on this page it is affecting the background
http://www.designculturestudio.com/best/website-combo/habitatfruitvale.html