PDA

View Full Version : background-image-carousel: seconde desc-container?



schwiminator
02-28-2012, 04:30 AM
1) Script Title: Background Image Carousel

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

3) Describe problem: Is there any chance to add a second description-container to this script?
what i tried to success:
- i added a second div.slide div.desc2 in the head-section
- i tried several things in the .js-file.

i think the important point in the script to change is this point:

+ ((imgref[1])? '<div class="desc" style="display:none">' + imgref[1] + '</div>\n' : '')
+ ((imgref[2])? '<div class="desc2" style="display:none">' + imgref[2] + '</div>\n' : '')
+ '</div>'

A pity I have no idea, what "imgref" does...

Thanks a lot for help in advance! :)

schwiminator
03-02-2012, 11:59 AM
Found the solution by myself.
But I have another question. Is it possible to link directly to one specific slide image? Somethink like this: www.url.com/#secondslide

Thanks for your help!

ddadmin
03-02-2012, 09:17 PM
schwiminator, try the below modified .js file, which should let you select a particular slide to show when the page loads if there's a hash tag in the URL in the form of:


yoursite.com/#INTslide

Where int is a number from 0 onwards (0=1st slide, 1=2nd slide etc). More examples of valid hash tags:


yoursite.com/mypage#0slide
yoursite.com/mypage#1slide

Reload the page upon changing the hash tag to see the selected image change.

schwiminator
03-04-2012, 06:52 PM
Okay, thanks! But is there also a possibilty to get direct links - no hashs?
That I can just put a <a href=...> ?
Cause now you MUST reload the page....

schwiminator
03-07-2012, 10:11 AM
And another question:
I now have two desc-container. Is it possible that one hides after e.g. 2 seconds? I thought I only could add those jQuery-codes in the js-code in line 59:

.find('desc1').slideDown().find('desc2').stop().hide(blind,,2000)

And the same in line 117.

But that doesnt work. Any ideas? Thanks!