(function() {
var arrayQ = [{
quote: "The material world is a dangerous place to be in. It's dangerous because there is a temptation of illusory energy; there is danger at every step.",
source: "HH GOPAL KRISHNA GOSWAMI",
citation: "ISKCON DESIRE TREE",
year: 2016
}, {
quote: "If you carry out the order of your spiritual master then the Lord will be so pleased that He will come to see you.",
source: "HH GOPAL KRISHNA GOSWAMI",
citation: "ISKCON DESIRE TREE",
year: 2013
}, {
quote: "Our vaccination is chanting the names of Krishna, Hearing the Bhagavad-gita and Srimad Bhagavatam, and thinking of Krishna all the time.",
source: "HH GOPAL KRISHNA GOSWAMI",
citation: "ISKCON DESIRE TREE",
year: 2003
}, {
quote: "Vairagya means that when the opportunity for sense gratification is there, I voluntarily abstain from it.",
source: "HH GOPAL KRISHNA GOSWAMI",
citation: "ISKCON DESIRE TREE",
year: 2006
}, {
quote: "Our quota is not sixteen rounds, but attentive sixteen rounds.",
source: "HH GOPAL KRISHNA GOSWAMI",
citation: "ISKCON DESIRE TREE",
year: 2009
}, {
quote: "Guru is pleased when he sees that the disciple is showing the symptoms of Shudh Bhakti.",
source: "HH GOPAL KRISHNA GOSWAMI",
citation: "ISKCON DESIRE TREE",
year: 2010
}, {
quote: "Devotional service is so simple, but devotees because of their material inclinations make it complicated.",
source: "HH GOPAL KRISHNA GOSWAMI",
citation: "ISKCON DESIRE TREE",
year: 2011
}, {
quote: "Whatever we give to Krishna that will be remembered eternally, that will be appreciated eternally.",
source: "HH GOPAL KRISHNA GOSWAMI"
}, ];
var randomQuotes = function() {
var getRandomInt = function(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
},
index = getRandomInt(0, arrayQ.length),
quote = arrayQ[index];
if (quote) {
console.log(quote);
arrayQ.splice(index, 1);// remove quote from array
}
};
setInterval(function() {
randomQuotes()
}, 1000);
})();
あなたはここにあなたのjsを貼り付けてもらえますか? – James
'otherList.push(mainList.splice(index、1))'は、メイン配列から項目を削除して別の配列に入れたいコアコードです(または、配列をシャッフルしてから 'other.push (main.pop()) ') –