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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:59:27+00:00 2026-05-23T07:59:27+00:00

$(document).ready(function() { $(‘.previewnetcoid’).html(‘<img src=/www-static/assets/images/ajax-loader.gif style=display: block; margin: 170px auto;>’); $(window).load(function () { $(‘.previewnetcoid’).show(); $(‘.previewnetcoid’).cycle({

  • 0
$(document).ready(function() {
    $('.previewnetcoid').html('<img src="/www-static/assets/images/ajax-loader.gif" style="display: block; margin: 170px auto;">');
    $(window).load(function () {
        $('.previewnetcoid').show();
        $('.previewnetcoid').cycle({
            fx: 'scrollLeft', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
            speed:    2000,
            timeout:  6000
        });
    });
});

as you can see, im trying to do give a loader then when if all of my image loaded it will show the images. i think i get it wrong here. it only shows the loader

edit* my progress

<script type="text/javascript">
$(document).ready(function() {
    $('.previewnetcoid').hide();
    $(window).load(function () {
        $('#ajax-loader').hide();
        $('.previewnetcoid').show();
        $('.previewnetcoid').cycle({
            fx: 'scrollLeft', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
            speed:    2000,
            timeout:  6000
        });
    });
});

Thanks for looking in

Adam Ramadhan

  • 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-05-23T07:59:27+00:00Added an answer on May 23, 2026 at 7:59 am

    You replaced the content of the element represented by .previewnetcoid with the loader, so the original content is gone. Thus, there’s nothing to cycle.

    Also, this isn’t even done until the page has already been completely loaded ($(document).ready()), so you’re effectively waiting until the page is completely rendered to show a loading animation. That’s obviously not right.

    You should place the loading animation HTML in the actual document, and use CSS to make it cover and hide the page (positioned absolutely, with 100% width and height, and a background). Then, in your javascript have it hidden on page load.

    Alternatively, you should probably write the loading HTML with JavaScript:

    <script>document.write(...)</script>
    

    Otherwise, if a user has JavaScript disabled, they’ll get the loading image, but it will never be removed.

    EDIT: (providing example)

    CSS

    .loading {
        position:absolute;
        left:0; top:0;
        width:100%; height:100%;
        background:#000;
        z-index:9999;
    }
    

    HTML

    <head>
        ...
        <link href="loading.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <script type="text/javascript">
            document.write('<div class="loading"><img src="loading.gif" alt="Loading..." /></div>');
        </script>
        ...
    

    JS

    $(document).ready(function(){
        $('.loading').hide();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(document).ready(function() { $('#content').html(''); $.ajax({ url:'data.json', dataType: json, success: function(data) { $('#content').append('<p>'+data.rank+'</p>'); } });}); In
$(document).ready(function() { var response = $.ajax({ type: GET, url : http://www.google.com, async : false,
$(document).ready(function () { // Hide all large images except the first one $('#imageContainer img').hide().filter(':first').show();
$(document).ready(function(){ $('.choices a img').click(function(e) { var url = $(this).attr('href') + ' .con_cen2'; $('.con_cen').html('loading...').load('signup.html'); e.preventDefault();
$(document).ready(function(){ $(.txtDate).datepicker({ showOn: both, buttonImage: library/ui/datepicker/img/calendar2.gif, dateFormat: yy/mm/dd, buttonImageOnly: true }); //added this checkbox
$(document).ready(function() { $('form#search').bind(submit, function(e){ e.preventDefault(); $('#content').html(''); // Define the callback function function getGeo(jsonData) {
$(document).ready(function(){ $('a[rel=addhint]').click(function(){ var html='<div><label>Hint</label>'; html+='<span class=input><input type=text size=30 class=text name=hint/><a href=# rel=delhint>delete</a></span><br class=clear /></div>';
$(document).ready(function(){ $('img').click(function(){ var class = $(img).attr(class); console.log(class); }); }); Back with another question. I
$(document).ready(function () { $('form#search').bind(submit, function (e) { e.preventDefault(); $('#content').html(''); var query1 = urlencode($('input[name=user_a]').val()); //userA
$(document).ready(function() { $(".addtophundredwatchlist").click(function() { $.ajax({ type : "GET", url : "/watchlisttophundred/", success : function(data){

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.