File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,14 @@ function changeTabs(e) {
73
73
. removeAttribute ( "hidden" ) ;
74
74
}
75
75
76
- ///////////////////////////////////////
77
- // rotate images in images-rotate directory:
78
- var ind = getRandomInt ( images_rotate . length ) ;
79
- var im = images_rotate [ ind ] . image ;
80
- st = '<img class="imrot-img" src="_static/images-rotate/' + im + '" />'
81
- var cap = images_rotate [ ind ] . caption ;
82
- var link = "https://matplotlib.org/stable/" + images_rotate [ ind ] . link ;
83
- st2 = '<div class="imrot-cap">' + cap + '</div>'
84
- document . getElementById ( 'image_rotator' ) . innerHTML = '<a href="' + link + '"> ' + st + st2 + '</a>' ;
76
+ document . addEventListener ( "DOMContentLoaded" , function ( event ) {
77
+ ///////////////////////////////////////
78
+ // rotate images in images-rotate directory:
79
+ var ind = getRandomInt ( images_rotate . length ) ;
80
+ var im = images_rotate [ ind ] . image ;
81
+ st = '<img class="imrot-img" src="_static/images-rotate/' + im + '" />'
82
+ var cap = images_rotate [ ind ] . caption ;
83
+ var link = "https://matplotlib.org/stable/" + images_rotate [ ind ] . link ;
84
+ st2 = '<div class="imrot-cap">' + cap + '</div>'
85
+ document . getElementById ( 'image_rotator' ) . innerHTML = '<a href="' + link + '"> ' + st + st2 + '</a>' ;
86
+ } ) ;
You can’t perform that action at this time.
0 commit comments