parallax
parallax copied to clipboard
add option to use inline styles for positioning
Solves issues #242 and #273.
In some cases, using inline styles for positioning parallax elements forces developers to override css properties with !important
, which is inelegant at best and impossible at worst.
I added a useInlinePosition
option (set to true, which is the current behavior, so it does not break anything) to stop using inline positioning for parallax elements.
I did not update the data attribute API because this is a behavior which is normally decided on website level, not element-by-element.
@wagerfield can this be approved?
See use case: https://stackoverflow.com/questions/74942946/how-to-disable-parallax-js-on-element-click/74943055#74943055
Currently, one must either override the inline styling through JS or use !important
which is bad practice but forced in these scenarios (see Overriding 3rd party code & inline styles.)