PDA

View Full Version : Resolved fade slide show v2.4 not working when links supplied.



simonrigga
10-08-2014, 12:39 PM
1) Script Title: fadeslideshow v2.4

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

3) Describe problem: I have the fadeslideshow script working perfectly, and it's working when I supply links mostly. I have one implementation where the JQuery fails, and i'm not at all sure why.

There is this line in the js


var $curimage=setting.$gallerylayers.html(fullhtml).find('img').hide().eq(setting.curimage) //prefill both layers with entire slideshow content, hide all images, and return current image

And when the fullhtml (as shown below)


a href=\"/InTouchWeb2010/frmProfile.aspx?A=__42\" target=\"_blank >\n<img src=\"StaticFiles/ITW_0000000901.jpg\" style=\"border-width:0;\" />\n</a>\n<a href=\"/InTouchWeb2010/frmProfile.aspx?A=__43\" target=\"_blank >\n<img src=\"StaticFiles/ITW_0000000902.jpg\" style=\"border-width:0;\" />\n</a>\n

is supplied $curimage has a length of 0, which then further down the code on this line,


if ($curimage.get(0).complete){ //accounf for IE not firing image.onload

errors. I'm not at all sure why the $curimage length is 0 given the above fullhtml

If I remove the links it works perfectly. With the following in fullhtml


<img src=\"StaticFiles/ITW_0000000901.jpg\" style=\"border-width:0;\" />\n<img src=\"StaticFiles/ITW_0000000902.jpg\" style=\"border-width:0;\" />\n

It's almost as if the find('img') is not working correctly given the first fullhtml

Anyone any ideas?
Thanks in advance.
SR.

ddadmin
10-08-2014, 01:59 PM
I've a little confused what you're trying to do here- are you modifying the default line:


var fullhtml=fadeSlideShow.routines.getFullHTML(setting.imagearray)

somehow? What is it you wish to accomplish?

simonrigga
10-08-2014, 02:49 PM
No I haven't modified that line at all.

Sorry for not being clearer,

I have a problem where the images are not displaying, and I have tracked it down to the line as shown in the OP, and below,


var $curimage=setting.$gallerylayers.html(fullhtml).find('img').hide().eq(setting.curimage) //prefill both layers with entire slideshow content, hide all images, and return current image

The full html that is going into this line is as follows,


a href=\"/InTouchWeb2010/frmProfile.aspx?A=__42\" target=\"_blank >\n<img src=\"StaticFiles/ITW_0000000901.jpg\" style=\"border-width:0;\" />\n</a>\n<a href=\"/InTouchWeb2010/frmProfile.aspx?A=__43\" target=\"_blank >\n<img src=\"StaticFiles/ITW_0000000902.jpg\" style=\"border-width:0;\" />\n</a>\n

So it seems the

var fullhtml=fadeSlideShow.routines.getFullHTML(setting.imagearray)
Is working perfectly.

What isn't working is the first code line above, where it tries to find the img tags from within the fullhtml variable. If I exclude the links as explained in the OP then it runs correctly and $curimage ends up populated, but with the fullhtml line as shown above the code ends up not populating the $curimage correctly.

And i'm stumped as to why.

I hope this is a little clearer.
SR

simonrigga
10-08-2014, 03:48 PM
Just to let you know I have solved this issue, and it was down to the additions I had made to the fadeslideshow js script to enable Google analytics tracking of click through on the image links.

I thank you and also apologise for any efforts you have made to solve this, as it was my error in the first place.

Regards, SR