• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Parallax Scrolling Problem

New Here ,
Jan 21, 2017 Jan 21, 2017

Copy link to clipboard

Copied

Hi, I want to apply parallax scrolling in adobe muse fluid width. I use this code-

<script type="text/javascript">

    var ypos,image;

    function parallex() {

        image = document.getElementById('u115');

        ypos = window.pageYOffset;

        image.style.top = ypos * .7+ 'px';

    }

    window.addEventListener('scroll', parallex),false;

</script>

Here is the link-Home

It works when I used hero image and "image.style.top = ypos * .7+ 'px'". But its not work in center position image. I tried to use  image.style.fixed/relative/center/absolute. Only work in image.style.top. If I use it center position image by image.style.top, image jump in top when I scroll. How do I fix it? Any solution for middle or center image?

Thank you

Views

565

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 22, 2017 Jan 22, 2017

then I suggest top, left of the browser 1 pixel down and in as the only option

Votes

Translate

Translate
LEGEND ,
Jan 21, 2017 Jan 21, 2017

Copy link to clipboard

Copied

khairultohin1 wrote:

How do I fix it?

you don't! thats why parallax scrolling only works in fixed breakpoints

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2017 Jan 22, 2017

Copy link to clipboard

Copied

Fix it means, I mean how could I solve this problem? Please see my link, you will understand what I want to be say. I need this parallax effect in any photo of this project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 22, 2017 Jan 22, 2017

Copy link to clipboard

Copied

LATEST

then I suggest top, left of the browser 1 pixel down and in as the only option

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines