{"size": 671, "ext": "js", "max_stars_repo_path": "02/main.js", "max_stars_repo_name": "irene0613/web_practice_20210410", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "02/main.js", "max_issues_repo_name": "irene0613/web_practice_20210410", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "02/main.js", "max_forks_repo_name": "irene0613/web_practice_20210410", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.5, "max_line_length": 114, "alphanum_fraction": 0.5558867362}
var i1 = 0;

function move() {
    i1++;
    if (i1 > 2) i1 = 0;
    $("h1").text($("li").eq(i1).text());
}
run1 = window.setInterval("move()", 250);

$(function() {
    $("input").on("click", function() {
        clearInterval(run1);
        var numberOfListItem = $("li").length;
        var randomChildNumber = Math.floor(Math.random() * numberOfListItem); //Math.floor取整數,Math.random()為0-1的小數
        $("h1").text($("li").eq(randomChildNumber).text());
        var myimages = new Array()
        myimages[0] = "0.jpg"
        myimages[1] = "1.jpg"
        myimages[2] = "2.jpg"
        document.getElementById("myImage").src = myimages[randomChildNumber];
    });
});