简体   繁体   中英

show and hide Javascript (display:none) issue

I have created a show/hide javascript function which seems to work perfectly - When you click on the link it reveals the gif version of the logo.

The issue i'm having is when you first go onto the landing page click here you can see both images, it's only when you click on the still image the function works the way is should - only displaying one image at a time. Does anyone know how i can resolve this problem?

你必须给图像一个display:none样式也可以开始:

<img id="center-img-gif" alt="main-img" src="css/images/logo.gif" style="display:none;">

use CSS property Display:none; for one of the images.

您可以设置display:none在设计时一个图像,或者你可以设置display:none一个图像对body onload

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM