PDA

View Full Version : Hyperlink Images inside JQuery Carousel


johnMoss
09-11-2012, 05:03 PM
I found some info on this but they didn't get specific on the whole procedure.

Objective: Click on a picture to visit an external link.

http://www.johnmossdesigns.com/websites-by-john-moss-designs.html

Wrapping the image in an href tag is ineffective as a stand-alone.
I get the impression 'permission' has to be granted to Objects inside the carousel for this to work. I found code for that but they didn't stipulate the complete procedure.

Anyone?

gentleone
09-11-2012, 05:54 PM
the images are not clickable, cause the the slider plugin converts the images somehow to background images and those background images is what you see in the slider... not the images in your HTML.

If you take a look with 'inspect element' to the HTML you see that the plugin adds a div with the class 'pic' to the DOM and there you see the images as background images changing through a cycle.

It's working like that otherwise it can't make those transitions of the images (I guess).

johnMoss
09-11-2012, 06:02 PM
Interesting... well then once again here comes the game. The individual pictures are independent objects. So the question is now definitively how to add permissions to these objects. Let the fun begin :)

gentleone
09-11-2012, 06:14 PM
Interesting... well then once again here comes the game. The individual pictures are independent objects. So the question is now definitively how to add permissions to these objects. Let the fun begin :)
You can't. Well at least not with these type of sliders. The images you see are not the images in your HTML. It became CSS background images injected by the jQuery plugin into the DOM.

domedia
09-11-2012, 06:33 PM
It's not a 'permission' thing John. (you just made it up 8) )=

You cannot add links to background images.

johnMoss
09-11-2012, 06:48 PM
Do you recall that witch-doctor in "The Heart of Darkness"... Standing over the outboard's diesel engine, shaking his rattle, spewing incantations and trying to make it start?
Well he was serious d___ and so am I :).

Permissions is the wrong word, attribute is the correct one. I've read into some stack-overflow threads and they're doing it on some scripts, but perhaps not this type. I may just come along & add some click images below the gallery, but I'm thinking this is somehow do-able...
Rattle in hand ergo...

gentleone
09-11-2012, 07:20 PM
It's probably doable if you change/add some functions in the jQuery script of the plugin. You can wrap div 'pic' in an anchor tag and add href attributes dynamically with some jQuery trickery.

johnMoss
09-12-2012, 03:30 AM
Precisely... I played with that a bit but had to move on to tasks at hand...
i'll give it anther go in a couple days.