Don't force usage of 'jarallax-img'
coldpumpkin opened this issue · comments
coldpumpkin commented
Issue description:
I noticed that if my <img>
tag doesn't have the "jarallax-img" class, then it doesn't work. Shouldn't the script search for the <img>
or <picture>
tags instead? Seems like a redundancy, there's no need to include this class if I already defined the container in JS.
Version used:
1.12.8
Code to reproduce the issue (HTML blocks + JavaScript initialization)
<div class="something">
<img src="someimage.jpg">
</div>
$('.something').jarallax({
speed: 0.5
})
Nikita commented
Containers contain different content in most cases. Content with text, photos, galleries, etc. This is why we should use the image class. If you don't need this class, change the selector string to your own in option imgElement
https://github.com/nk-o/jarallax#options