A div superimposed on an image descends according to the scroll bar

0

I have a div that shows some details about an image when it is displayed, however I'm developing it for mobile and when you slide down the divs that contain those details also move out of the images.

Follow the project link in gitHub.

LINK: link

    
asked by anonymous 10.04.2015 / 07:44

2 answers

0

My friend, I checked your code. Firstly I saw that they had several "ids", I advise you to use a class (also changing css):

File touchTouch.jquery.js

$('<div class="dadosRoupa">').html(text);

Another thing I noticed was that it came down because of this code here:

var $spanInPlace = target.find("div"),
            $targetImage = target.find('img'),
            distanceBot  = target.height() - $targetImage.offset().top - $targetImage.height();

        $spanInPlace.css({"bottom": distanceBot+"px"});

I would change to:

   $spanInPlace.css({"bottom": "0px"});

So it always takes the same position.

I hope I have helped.

    
10.04.2015 / 15:59
0

To put a div that accompanies the toolbar, you must set it to position: fixed;  so the top point: x or bottom: x of css, will stay fixed, even if you drop the scroll bar.

    
10.04.2015 / 15:37