Open lexoyo opened 7 years ago
Hello, I am just experimenting with Silex and so far it looks great. It is true DIY, not those shiny websites like WIX that just push you into templates.. It is perfect, blank template and also with download and code editors. But as I was experimenting with those parallax effects it always looks like the container centers itself to top left corner when mouse hovers over the page. Is there anything I can do to edit this behavior? I want to have the effect on center. but i dont seem to figure out how to do it. Thanks in Advance
Okay, it looks like I fixed with editing certain numbers by the offset: (changed divider from 2 to 5)
if(typeof initialOffsetX === 'undefined') $(target).attr('data-paralax-initial-offset-x', $(target).offset().left - parentOffset.left - ($(container).width() / 5)); if(typeof initialOffsetY === 'undefined') $(target).attr('data-paralax-initial-offset-y', $(target).offset().top - parentOffset.top - ($(container).height() / 5));
Hello So it works better with 5?
It did. Today i opened the page on different computer with different screen size and the layer-one image was again completely offset form its default x and y coordinates. Oh, and also. it doesnt center to top left corner, it looked like it. It just offsets according to the numbers in the javascript.
could you put all this online somewhere so that I can see?
About parallax
Parallax scrolling and parallax hovering effects look great on a website. With this widget you will add this type of animations to your Silex website.
Setup this widget
Paste this code into the JS editor (see here the help section about the JS editor)
Scroll parallax effect
Select a section of your website and add the CSS class
scroll-parallax
to the section's background element.Then add elements to this section (in its background or in the container in the middle) and add the CSS class
layer-one
orlayer-two
orlayer-three
to each elementYou can save and preview your website, then scroll in it to see the elements in each layer move at different speed
Mouse parallax effect
Select a section of your website and add the CSS class
mouse-parallax
to the section's background element.Then add elements to this section (in its background or in the container in the middle) and add the CSS class
layer-one
orlayer-two
orlayer-three
to each elementYou can save and preview your website, then move your mouse around to see the elements in each layer move at different speed