reverse.js
来自「这是《JavaScript学习源代码》一书的源代码」· JavaScript 代码 · 共 20 行
JS
20 行
// create a new array of image URLs
var imgs = new Array("img1.gif","img2.gif","img3.gif");
// create a control variable
var rev = false;
// when the slideshow displays the final image
// ...reverse the order
rev = true;
if( rev == true )
{
imgs.reverse();
}
// display the reversed element order
alert( imgs.join(" - ") );
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?