Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery, asp.net ajax, javascript not executing at all
    primarykey
    data
    text
    <pre><code>&lt;script type="text/javascript"&gt; function pageLoad() { var $scrollingDiv = $("#scrollfix"); $(window).scroll(function () { if ($(window).scrollTop() == $(document).height() - $(window).height()) { __doPostBack('&lt;%= GetMoreResults.UniqueID %&gt;', ''); } $scrollingDiv .stop() .animate({ "marginTop": ($(window).scrollTop()) + -60 + "px" }, "slow"); }); } &lt;/script&gt; </code></pre> <p>This code does not execute at all, the reason i'm using the pageLoad function is because the jquery code failed to execute after updatepanel partial postback. But then after using this one, none of the code above works even on first page startup.</p> <p>However, the code that USED to work on page load is below but the jquery part STOPPED working after postback: </p> <pre><code>$(document).ready(function () { $().ready(function () { var $scrollingDiv = $("#scrollfix"); $(window).scroll(function () { if ($(window).scrollTop() == $(document).height() - $(window).height()) { __doPostBack('&lt;%= GetMoreResults.UniqueID %&gt;', ''); } $scrollingDiv .stop() .animate({ "marginTop": ($(window).scrollTop()) + -60 + "px" }, "slow"); }); }); }); </code></pre> <p>Solutions? Thanks alot.</p> <h2>UPDATE #2</h2> <p>This is my current code: It works the first time the page loads, but not after the partial postback trigger by the __doPostBack.</p> <pre><code>&lt;script type="text/javascript"&gt; window.load = pageLoad(); function pageLoad() { var $scrollingDiv = $("#scrollfix"); $(window).scroll(function () { if ($(window).scrollTop() == $(document).height() - $(window).height()) { __doPostBack('&lt;%= GetMoreResults.UniqueID %&gt;', ''); } $scrollingDiv .stop() .animate({ "marginTop": eval($(window).scrollTop()) + -60 + "px" }, "slow"); }); } &lt;/script&gt; </code></pre> <h2>UPDATE #3</h2> <p>I should mention that this page does not inherit from Page, I've made a custom page class called BasePage : Page.</p> <p>Maybe pageLoad() does not fire for some reason related to this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload