3

I am trying to get offset top value of an element while window is resizing.

I have written this function:

function setPosTop() {
    var offtop = document.getElementsByClassName('cycloneslider-caption')[0].offsetTop;
    console.log('offtop ', offtop);
}

Its working fine on window load, but its not getting the correct value on window resize function.

I have searched and applied many options but not working correctly.

Please provide me solution / magic code regarding this issue. Thanks

Subhajit Das
  • 399
  • 7
  • 19

0 Answers0