Posts

Showing posts with the label race-condition

On Page Load Offset Value set to 0. On Inspection value is calculated

Image
Clash Royale CLAN TAG #URR8PPP On Page Load Offset Value set to 0. On Inspection value is calculated The goal is to use a url fragid to jump to a particular section on a separate page on page load. <a href="page.php#section> <a href="page.php#section> The unexpected behavior is that on page load the offsetTop does not seem to get calculated or the value gets overwritten. console.log($("#section").offset()); <script> jQuery(document).ready(function() {}) $(window).on('load', function() {}) all result in a console log of { top: 0, left:0 } . { top: 0, left:0 } However once the file is loaded, I manually open Dev Tools and enter console.log($("#section").offset()); and it returns the expected output of { top:200px, left: 200px } . - When I load the page without calling the LESS file the calculation happens. This leads me to believe that it is a race condition with LESS. However this seems strange that LESS would be fighting and ove...