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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:55:28+00:00 2026-06-14T12:55:28+00:00

I am not jQuery savy so this is probably my problem, but I want

  • 0

I am not jQuery savy so this is probably my problem, but I want to use this:

http://jsfiddle.net/hGcV2/1/

however the only problem is that I can’t even get it to work outside jsfiddle.
I have implemented jQuery before so I thought this was no different but seems like my low knowledge on this is getting the best of me.

HTML

<head>

<link rel="stylesheet" href="awwyea.css" type="text/css" media="all" >

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js">
</script>
<script src="yay.js"></script>
</head>
<body>
<div id="cycler">      
<div>A</div>        
<div>B</div>        
<div>C</div>        
<div>D</div>        
<div>E</div>        
<div>F</div>        
<div>G</div>        
<div>H</div>        
<div>J</div>      
</div>
</body>
</html>

CSS

#cycler{
  height:5em;
  overflow:hidden;
  border:1px solid gray;
}​

jQuery

function cycle($item, $cycler){
setTimeout(cycle, 2000, $item.next(), $cycler);

$item.slideUp(1000,function(){
    $item.appendTo($cycler).show();        
});

 }

cycle($('#cycler div:first'),  $('#cycler'));​

So simply put, why is it that when I run this code in a browser (chrome IE FF) using notepad++, with all the files in the same folder do I just have a static none scrolling:

A
B
C
D

Something just isn’t working.

  • 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-14T12:55:29+00:00Added an answer on June 14, 2026 at 12:55 pm

    Can’t really take credit for this… I think j08691 nailed it.

    You need to put the code in a jQuery ready call, since the elements have not been loaded when the script tries to run. You have the script (yay.js) loaded in the head (before the HTML elements in the body). So the script fails.

    In yay.js you would just wrap the start code like this (anything that requires the HTML document to have finished loading):

    jQuery(document).ready(function(){
        cycle($('#cycler div:first'),  $('#cycler'));​
    });
    

    Or shorthand syntax

    jQuery(function(){
        cycle($('#cycler div:first'),  $('#cycler'));​
    });
    

    JSFiddle will by default place all JavaScript code to run on window onload.
    You can make JSFiddle work like your HTML document locally by simply changing the Javascript wrapping method.

    If you change it to “no wrap (head)” you will need to add the jQuery document ready function or window onload to make the example work in JSFiddle as well.

    enter image description here

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

Sidebar

Related Questions

It works in jQuery 1.6.3 but not jQuery 1.6.4 http://jsfiddle.net/xxwr4/ $(#a).click(function(){ alert(click); }); <a
this is the problem: I'm using javascript and JQuery (not UI) to drag nested
I have a requirement that states to use only plain JavaScript and not jQuery.
I'm trying to use AJAX (not jQuery).... I basically have this going on. Content
I want to know how I can use javascript (not jquery) to execute a
[edit] I am NOT using jquery in this app. Looking for a way to
I have a little problem about using jQuery (I really do not know jQuery
my jquery code not run with IE6 but runs all others including IE7. It
Jquery does not work on the Internet explorer . However it runs on other
First off, I know this is a base JS issue, not jQuery. I am

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.