Loading encountered a problem, how to end the loading, can jump out of the function do not run the code?

clipboard.png

my code structure is like this
I think after on load, besides fadeOut, the js function on
also stops and stop running.
how can this be written?

Update

$(document).ready(function () {
    $(".pageloading").show();

    var curIndex=0;
    var timeInterval=90;

    var arr = new Array();
    arr[0]="images/ja/XY0001.png";
    arr[1]="images/ja/XY0002.png";
    arr[2]="images/ja/XY0003.png";
    arr[3]="images/ja/XY0004.png";
    arr[4]="images/ja/XY0005.png";
    arr[5]="images/ja/XY0006.png";
    arr[6]="images/ja/XY0007.png";
    arr[7]="images/ja/XY0008.png";

    var timer = setInterval(changeImg,timeInterval);
    function changeImg(){
      var obj=document.getElementById("obj");
      if(curIndex==arr.length-1){
        curIndex=0;
      }else{
        curIndex+=1;
      }
      obj.src=arr[curIndex];

      return changeImg();
    }
});

$(window).on("load", function(){
    $(".pageloading").fadeOut();

    window.clearInterval(timer);
});

do I have the right code
or am I weird
and he doesn"t seem to be running in sequence?


emmmm, should be minimized, with as few changes as possible. The changes are as follows:

var intervalTimer;
$(document).ready(function () {
    $(".pageloading").show();

    var curIndex=0;
    var timeInterval=90;

    var arr = new Array();
    arr[0]="images/ja/XY0001.png";
    arr[1]="images/ja/XY0002.png";
    arr[2]="images/ja/XY0003.png";
    arr[3]="images/ja/XY0004.png";
    arr[4]="images/ja/XY0005.png";
    arr[5]="images/ja/XY0006.png";
    arr[6]="images/ja/XY0007.png";
    arr[7]="images/ja/XY0008.png";

    intervalTimer = setInterval(changeImg,timeInterval);
    function changeImg(){
      var obj=document.getElementById("obj");
      if(curIndex==arr.length-1){
        curIndex=0;
      }else{
        curIndex+=1;
      }
      obj.src=arr[curIndex];
    }
});

$(window).on('load', function(){
    $(".pageloading").fadeOut();
    clearInterval(intervalTimer);
});

at the time var timer = setInterval (changeImg,timeInterval);

window.clearInterval (timer); after on load

(note that timer should be a global variable, otherwise this variable will not be married in onload)

(add:) try this
clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30bd9-40d7d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30bd9-40d7d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?