Thanks to visit codestin.com
Credit goes to github.com

Skip to content

I use a "position: absolute" in a div "position: relative". Is does not work. #61

@ZE3kr

Description

@ZE3kr

Such as

<div style="position: relative;bottom: 5em;left: 2px;">
  <a href="http://ze3kr.com/video/2014/07/12/s1/#video" title="Play">
    <img src="http://ze3kr.com/image/play.png" style="position: absolute;width: 72px;height: 72px;" class="js-plaxify" data-xrange="20" data-yrange="20" />
  </a>
</div>
var layers = $('.js-plaxify')

$(document).ready(function () {
    $.plax.enable()
})

It's does not work. I find "inViewport" is wrong, When elements in the Viewport, it is not recognized. When I was at the top of the page (not the actual inViewport), but it is recognized inViewport.

And I Change the HTML like that

<div style="position: relative;bottom: 5em;left: 2px;" class="js-plaxify" data-xrange="20" data-yrange="20">
  <a href="http://ze3kr.com/video/2014/07/12/s1/#video" title="Play">
    <img src="http://ze3kr.com/image/play.png" style="position: absolute;width: 72px;height: 72px;"  />
  </a>
</div>

It still not work. But I find it Automatically add this

div .js-plaxify {
  left: 173px;
  top: 936px;
}

At last, I add this and at finally it works.

layer.obj.css('position', absolute);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions