Parallax not working


Topic: Parallax not working

Sandro pro asked 6 years ago

I try using Parallax effect but i got "Uncaught ReferenceError: objectFitImages is not defined at index.html:179" on a fresh installation of mdb( i only add js and part of parallax code on index.html) Can i have some help?  
   

Piotr Glejzer staff answered 6 years ago

Hi, sure, I'm here to help you. But I have a request. May you use our snippets to show your code about parallax? Thank you. Edit. I checked in PRO package version 4.5.14 and everything is going well with that Link Parallax. Error 'Uncaught ReferenceError: objectFitImages is not defined' is showing when you are initiate code to parallax before code of mdb.js (probably). Check that your initiate is on last script tag after all script tags (like jquery, mdb.js etc). Let me know. Best, Piotr

Sandro pro commented 6 years ago

Yes i see i was that ;) thx for help, 

Just can you tell me how put img responsibe with parallax? i use class="img-fluid jarallax-img" but is not working


Piotr Glejzer staff commented 6 years ago

I think the reason why is not working is the fact a class 'jarallax-img' has own styles for height and width, that's why. You can do some 'hack' for that and more specifically use max-width and height to overwrite jarallax-img with img-fluid styles. Like something like this ->

.jarallax-img{
max-width:100%!important;
height:auto!important;
}
But is that what you want?

Sandro pro commented 6 years ago

http://sangdorthos.livehost.fr/capture/Desktop%202018.11.18%20-%2020.06.17.02.mp4

not working very well

<div class="view jarallax-keep-img">
<img src="img/<?= $images[4]['src_img'] ?>" class="jarallax-img">
</div>


Piotr Glejzer staff commented 6 years ago

Hi,

I think is not a possible use img-fluid class with jarallax-img properly cause jarallax plugins has own styles for working correctly and if you will add some classes like 'img-fluid' is gonna crash that code. We are sorry about that. We will gonna make some workaround about that. 

Best,

Piotr


Sandro pro commented 6 years ago

Yes please fix it, thank you


Piotr Glejzer staff commented 6 years ago

I put that problem to our task to do. Have a nice day.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.10
  • Device: PC
  • Browser: Chrome, Firefoxe, Edge
  • OS: WIndows 10 64bits
  • Provided sample code: No
  • Provided link: No