File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -138,9 +138,32 @@ <h1 class="post-title">Sensors</h1>
138138 < article >
139139 < p > < br > </ p >
140140
141- < figure style ="text-align: center; ">
142- < img style = "width: 90% " src ="../assets/gif/sensor_platform.gif " alt ="Image description ">
141+ < figure style ="text-align: center; position: relative; width: 90%; margin: 0 auto; ">
142+ <!-- 加载标记 -->
143+ < div id ="loading " style ="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); ">
144+ < span > Sensor-kit Overview Loading...</ span > <!-- 或使用一个加载动画 -->
145+ </ div >
146+
147+ <!-- 图片 -->
148+ < img id ="sensorImage " style ="width: 100%; display: none; " src ="/UrbanV2X/assets/gif/sensor_platform.gif " alt ="Image description ">
143149 </ figure >
150+
151+ < script >
152+ // 获取图片和加载标记
153+ const image = document . getElementById ( 'sensorImage' ) ;
154+ const loading = document . getElementById ( 'loading' ) ;
155+
156+ // 图片加载成功时
157+ image . onload = ( ) => {
158+ loading . style . display = 'none' ; // 隐藏加载标记
159+ image . style . display = 'block' ; // 显示图片
160+ } ;
161+
162+ // 图片加载失败时(可选)
163+ image . onerror = ( ) => {
164+ loading . innerHTML = 'Failed to load image' ; // 显示错误信息
165+ } ;
166+ </ script >
144167
145168
146169
You can’t perform that action at this time.
0 commit comments