當前位置:編程學習大全網 - 網站源碼 - 請教JS高手:網頁中如何以隱含方式加載圖片?

請教JS高手:網頁中如何以隱含方式加載圖片?

剛才給妳寫的,也不知道妳要的是不是這個結果

利用2個不同背景圖片的CSS 樣式相互切換樣式

以下代碼全部復制過去就可以用,妳要做的就是分別把CSS樣式中bg和bg1中的2張圖片換成妳自己的就OK 了 長度和寬度 妳可以根據自己的需要調整

下面是代碼

<style type="text/css">

<!--

.bg {

background-image: url(bg0.jpg);

background-repeat: no-repeat;

height: 25px;

width: 149px;

}

.bg1 {

background-image: url(bg.jpg);

background-repeat: no-repeat;

height: 25px;

width: 149px;

}

-->

</style>

<table id=bgimages1 width="149" height="24" border="1" cellpadding="0" cellspacing="0">

<tr>

<td width="173" class="bg" onMouseOut="this.className='bg1'" onMouseOver="this.className='bg'"> </td>

</tr>

</table>

隨便說以下

在<table><tr>中是壹樣的調用

<table>中

<table class="bg" onMouseOut="this.className='bg1'" onMouseOver="this.className='bg'" id=bgimages1 width="149" height="24" border="1" cellpadding="0" cellspacing="0">

<tr>中

<tr class="bg" onMouseOut="this.className='bg1'" onMouseOver="this.className='bg'">

  • 上一篇:c語音程序求助 最好有註釋 感謝感謝
  • 下一篇:時空偏離指數公式
  • copyright 2024編程學習大全網