Month: April 2018

jQuery: check if element is visible on screen

<div class=”container”> <div class=”text text-1″> Lorem ipsum <span></span> </div> <div class=”text text-2″> Lorem ipsum <span></span> </div> </div> .container { height: 100rem; } .container .text { text-align: center; font-size: 1.5rem; } .container .text.text-1 { margin-top: 5rem; } .container .text.text-2 { margin-top: 50rem; } .container .text span { color: #f20; } $(window).scroll(function(){ $(‘.text’).each(function(){ if(isScrolledIntoView($(this))){ $(this).children(‘span’).text(‘visible’); } else{ […]

Code to check when page has finished loading

Does this link answer your question? Example usage (in your C# code) protected void Page_Load(object sender, EventArgs e) { Page.LoadComplete +=new EventHandler(Page_LoadComplete); } void Page_LoadComplete(object sender, EventArgs e) { // call your download function }

How to do jquery code AFTER page loading?

Following $(document).ready(function() { }); can be replaced $(window).bind(“load”, function() { // insert your code here }); There is once more way which i’m using to increase the page load time. $(document).ready(function() { $(window).load(function() { //insert all your ajax callback code here. //Which will run only after page is fully loaded in background. }); });