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 8905151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:19:09+00:00 2026-06-15T02:19:09+00:00

I have the following code working in a jsfiddle: http://jsfiddle.net/S5Cjm/1242/ function InOut(elem) { var

  • 0

I have the following code working in a jsfiddle: http://jsfiddle.net/S5Cjm/1242/

function InOut(elem) {
var delayOn = 2000, // time each <li> should be visible
    delayOff = 0, // time between revealing each <li>
    fade = 1000; // fade duration

// Pause, fade in, pause again, fadeout, then fire the callback
elem.delay(delayOff).fadeIn(fade).delay(delayOn).fadeOut(function() {
    // If we're not on the last <li>
    if (elem.next().length > 0) {
        // Call InOut on the next <li>
        InOut(elem.next());
    }
    else {
        // Else go back to the start
        InOut(elem.siblings(':first'));
        }
    });
}

$(function() {
    // Hide all the li's
    $('#content li').hide();
    // Call InOut to loop through them
    InOut($('#content li:first'));
});

​
However, when embedded into my code it does not work.

I am referencing JQuery in my head thus:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

It worked inexplicably once and has not again despite replicating the code.

Any help greatly appreciated!

  • 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-15T02:19:10+00:00Added an answer on June 15, 2026 at 2:19 am

    This works for me:=) Nothing is wrong with your code except you forgot to wrap it inside $(document).ready(function(){});

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
    <meta name="author" content=""/>
    <meta name="description" content=""/>
    <meta name="keywords" content=""/>
    <title></title>
    <style type="text/css">
    *{margin:0px;padding:0px}
    </style>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"   type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    //alert('workin');
        function InOut(elem) {
        var delayOn = 2000, // time each <li> should be visible
        delayOff = 0, // time between revealing each <li>
        fade = 1000; // fade duration
    
    // Pause, fade in, pause again, fadeout, then fire the callback
       elem.delay(delayOff).fadeIn(fade).delay(delayOn).fadeOut(function() {
        // If we're not on the last <li>
        if (elem.next().length > 0) {
            // Call InOut on the next <li>
            InOut(elem.next());
        }
        else {
            // Else go back to the start
            InOut(elem.siblings(':first'));
        }
        });
        }
    
        $(function() {
        // Hide all the li's
        $('#content li').hide();
        // Call InOut to loop through them
        InOut($('#content li:first'));
        });
        });
       </script>
       </head>
       <body>
           <ul id="content">
           <li>first</li>
           <li>second</li>
           <li>third</li>
           <li>fourth</li>
           <li>fifth</li>
           <li>sixth</li>
           </ul>
       </body>
       </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that is working fine in jsfiddle - http://jsfiddle.net/darkajax/FHZBy/ I've
I have the following code working: http://jsfiddle.net/SzW7q/ Admins will be able to go in
I have the following working code: http://jsfiddle.net/NtHwN/4/ It will deduct the number that is
I have the following working code: http://jsfiddle.net/tu8tc/2/ I need to add some logic so
I have the following code: http://jsfiddle.net/fCWJ5/1/ , and following doubts regarding the viewbox. body{margin:0;}
I have the following code: http://jsfiddle.net/LvdcU/3/ I don't understand why I keep getting the
This is a link to the working jsfiddle http://jsfiddle.net/akshaytyagi/SD66b/ and following is the code
I have created the following code http://jsfiddle.net/N65yS/41/ .. My problem is this.. When I
This is the code I'm working from: http://jsfiddle.net/njDvn/36/ The weird thing is, the autosuggest
I finally got some parts working here: http://jsfiddle.net/trXBr/5/ but when I put the code

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.