Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to make ASP.NET control button fade out with JQuery
    primarykey
    data
    text
    <p>I have a simple enough problem: I have an ASP.NET control button and I want to make it fade out and then call some function (such as an alert) using JQuery. Here is what I have so far:</p> <p>ASP Code for the Button:</p> <pre><code>&lt;div id="begin"&gt; &lt;span id="startButtonSpan"&gt; &lt;asp:Button ID="startButton" class="startButton" runat="server" Text="Click Me!" OnClientClick="startButtonClick()"/&gt; &lt;/span&gt; &lt;/div&gt; </code></pre> <p>JavaScript:</p> <pre><code>function startButtonClick() { $("#startButtonSpan &gt; input").fadeOut(500, callAlert()); } function callAlert() { alert("Made it here..."); } </code></pre> <p>When I click the button, the alert displays but the page does not even seem to try to perform the fadeOut. When I close the alert, the button is still there, staring at me.</p> <p>Can anyone see any mistakes or does anyone have any suggestions on how I might be able to achieve the intended goal of fading out my button? Fadeout is really just my way of testing whether I can manipulate ASP controls using jQuery, so more than just the simple fadeOut, this is me trying to learn how to do that.</p> <p>I tried a slightly more simple jQuery call using the code below, but it does not seem to work either:</p> <p>ASP Portion:</p> <pre><code>&lt;div id="begin"&gt; &lt;span id="startButtonSpan"&gt; &lt;asp:Button ID="startButton" class="startButton" runat="server" Text="Click Me!" OnClientClick="startButtonClick()"/&gt; &lt;/span&gt; &lt;/div&gt; &lt;div id="jQueryTest" style="display:none;"&gt; Block for testing jQuery. &lt;h1 id="testMessage"&gt;Child element for the ASP div.&lt;/h1&gt; &lt;/div&gt; </code></pre> <p>Javascript Portion:</p> <pre><code>function startButtonClick() { $("#jQueryTest").css("display", "block"); $("#jQueryTest").show(); } </code></pre> <p>For this example, the text does display, but it immediately disappears again.</p> <p>Any help or suggestions as to what I might be doing wrong would be greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    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