我想通过单击按钮更改一组滚动图像。这里的问题是如何通过这些函数更改全局变量请参阅附带的代码,
我想在onload时启动stack()函数并更改onclick设置的滚动图像;
我应该添加一个onload事件并单独调用stack()函数,只使用本地var吗?谢谢,乔var images = imagest;function softtissue(){
var images = imagest;}function bone(){
var images = imagebone;}function lung(){
var images = imagelung;}var stack = new ImageStack({
images: images,
height: '512px',
width: '512px'});document.querySelector('.example').appendChild(stack);
Soft Tissue
Bone
Lung
// how to use the funciton on line 94
// for questions email felix@demont.is
var images10 = [
"https://igu3ss.files.wordpress.com/2012/09/chess_king_4.jpg",
"https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Chess_piece_-_Black_queen.JPG/130px-Chess_piece_-_Black_queen.JPG", "https://asmoodle.asmadrid.org/blog/s16240/wp-content/uploads/sites/56/2014/12/protourney_knight_black_400.jpg",
"https://thumbs.dreamstime.com/x/chess-knight-white-background-29811348.jpg",
"http://cdn.craftsy.com/upload/3703789/pattern/115774/full_7439_115774_ChessKnightMachineEmbroideryDesign_1.jpg"
];
var imagesbone = [
"https://igu3ss.files.wordpress.com/2012/09/chess_king_4.jpg",
"https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Chess_piece_-_Black_queen.JPG/130px-Chess_piece_-_Black_queen.JPG", "https://asmoodle.asmadrid.org/blog/s16240/wp-content/uploads/sites/56/2014/12/protourney_knight_black_400.jpg",
"https://thumbs.dreamstime.com/x/chess-knight-white-background-29811348.jpg",
"http://cdn.craftsy.com/upload/3703789/pattern/115774/full_7439_115774_ChessKnightMachineEmbroideryDesign_1.jpg",
"https://igu3ss.files.wordpress.com/2012/09/chess_king_4.jpg",