SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    JQuery fadeout small question

    Hai falks,

    i have a button in a page. when click, it should fade out slowly, then should go back to previous page.
    with below code what happens is, it just go back immediately without fading out.
    if i comment (//) the parent.hisotry.back line, then fadeout works perfectly. whats the problem?

    Code:
    <script>
      $("#back").click(function () {
      $("#print").fadeOut("slow");
      parent.history.back();
      return false; 
      });
    </script>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by afridy View Post
    whats the problem?
    Look at the documentation page the .fadeOut() and you'll see that it also accepts a callback parameter, which is a function that gets run only after the fadeout has finished occurring.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •