0
I have for example the following structure
<div style="height: 1500px;">
<div id="dv1" style="height: 600px">
conteudo 1
</div>
<div id="dv2" style="height: 300px">
conteudo 2
</div>
<div id="dv3" style="height: 300px">
conteudo 3
</div>
<div id="dv4" style="height: 300px">
conteudo 4
</div>
</div>
And always while scrolling, I would like to get the current position of the div "content 3"
I tried to get by clicking on some other div and nothing, by scrolling the same scroll I would like to do and nothing tbm.
var a = $('#dv2').scrollTop();
alert(a);
Something like: How to put scroll at the end of div?
– Marconi
@Marconi no friend, I wanted to get his position in relation to the scroll. For example with this code: var div = $('#general-menu'); $(window). scroll(Function() { if ($(this).scrollTop() > 35) { div.removeClass("general-menu-normal"); div.addClass("general-menu-Fixed"); } Else { div.removeClass("general-menu-Fixed"); div.addClass("general-menu-normal"); } }); I can check if the scroll is larger q 35 to set the fixed menu, in this same footprint, I wanted to pick up the position of the div
– AntonioSantos