Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<html>
    <body>
        <style>
            body{
                padding:0;
                margin:0;
            }
            div{
                border:50px solid #1065e6;
                padding:50px;
                margin:50px;
            }
            #target{
                width:100px;
                height:2000px;
            }
        </style>
                <div>
                    <div id="target">
                        Coding
                    </div>
                </div>
        
        <script>
        var t = document.getElementById('target');
        setInterval(function(){
            console.log('getBoundingClientRect : ', t.getBoundingClientRect().top, 'pageYOffset:', window.pageYOffset);
        }, 1000)
        </script>
    </body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
egoingpro
0viewers