Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8146795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:07:19+00:00 2026-06-06T14:07:19+00:00

<script type=text/javascript> $(document).ready(function() { $(body).css(display, none); $(body).fadeIn(slow); $(a.link).click(function(event){ event.preventDefault(); linkLocation = this.href; $(body).fadeOut(slow, redirectPage);

  • 0
<script type="text/javascript">
$(document).ready(function() {
$("body").css("display", "none");
$("body").fadeIn("slow");
    $("a.link").click(function(event){
        event.preventDefault();
        linkLocation = this.href;
        $("body").fadeOut("slow", redirectPage);        
    }); 
    function redirectPage() {
        window.location = linkLocation;
    }
});
</script>

It does not work “fadeOut” when using “onclick”. As can be implemented without using the “href”?

<a class="link" onclick="window.location='index.php'">index.php</a>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:07:21+00:00Added an answer on June 6, 2026 at 2:07 pm

    You script works with this:

    <a class="link" href="http://google.de">index.php</a>
    

    It fades out the “body” and afterwards it redirects to google.

    It also works without the href:

    <a class="link">index.php</a>
    

    In this case it will just “refresh” the current page.

    If you don’t want to store the link within the href-attribute, you can do this:

    <a class="link" data-link="index.php">index.php</a>
    

    This is valid HTML and you can, instead of the href-attribute read the new one:

    $(this).attr('data-link');
    

    You don’t have to set another “onclick” handler within the link. Because this one will fire first, before the jQuery event handler gets it’s work done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got the following code : <script type=text/javascript> jQuery(document).ready(function(){ var Opened = false; jQuery('.expend-schedule').click(function(e){
Here is fragments of my HAML view: %script{:type => text/javascript, :src => assets/application.js} :javascript
I have a jQuery script: $.ajax({ url: /scripts/secure/development/ajax.asp, type: POST, dataType: text, data: cmd=addresses,
Why does $(document).ready(function() not work in the following example? If I take it out,
<!DOCTYPE html> <html> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8/> <title>FAQ Section</title> <link rel=stylesheet type=text/css href=styles.css/>
I've tried to change filenames using following script: find dir/ -type f -exec mv
I am calling a service that return JSON data. Script: $.ajax({ type: "POST", url:
OK I have a simple script at http://kleague.org/test/ Type a movie name and it
I have this jQuery script var dataString = class_id=+class_id; $.ajax({ type: POST, url: page.php,
I have a Perl script called replaceUp: #!/usr/bin/perl search=$1 replace=$2 find . -type f

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.