nk-o / jarallax

Parallax scrolling for modern browsers

Home Page:https://jarallax.nkdev.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't force usage of 'jarallax-img'

coldpumpkin opened this issue · comments

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
})

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