How do you control what image Unveil controls?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

How do you control what image Unveil controls?

Post by simonmlewis »

https://luis-almeida.github.io/unveil/
We are trying to use this on our homepage. It has mostly DIVs with images.
But at the top, we use the "Owl" slider. If I use this unveil, it kills that slider, and stops it working.

Is there a way to tell, per page which images NOT to use unveil? As the script just seems to overide all "img" tags in the page, after the script.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How do you control what image Unveil controls?

Post by Celauran »

Sure. Instead of $('img'), just use a different selector.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do you control what image Unveil controls?

Post by simonmlewis »

How? Is it not tied to the img tag?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How do you control what image Unveil controls?

Post by Celauran »

That's just a selector. You could toss an 'unveil' class on the images you want affected and then use

Code: Select all

$('img.unveil').unveil();
Post Reply