第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

嘗試將文本和圖像添加到 onmouseover

嘗試將文本和圖像添加到 onmouseover

九州編程 2022-06-16 10:57:08
我還是一個(gè)新手,正在嘗試將圖像添加到項(xiàng)目的描述中。理論上,當(dāng)用戶將鼠標(biāo)懸停在項(xiàng)目上時(shí),旁邊的列中會(huì)顯示圖像和描述。我知道我在使用雙引號(hào)和單引號(hào)時(shí)做錯(cuò)了什么,但我不確定它是什么。            function gettip(txt)            {                document.getElementById('info').innerHTML=txt;            }function reset(){    document.getElementById('info').innerHTML="Roll over a link for information on the project! "}<a href="Homework.html"                onmouseover="gettip('<img src='Images/homeworkpreview.jpg'><br><br><b>Due:</b> January 27 <br> <b>Points:</b> 50 <br> <br> <b> Description: </b> <br> Create a Homework page with a table with information about the projects for this semester. This will act as the hub for all of your projects to be linked to.')"                onmouseout="reset()"> Homework </a> 
查看完整描述

2 回答

?
翻翻過去那場雪

TA貢獻(xiàn)2065條經(jīng)驗(yàn) 獲得超14個(gè)贊

您可以使用反引號(hào) (`),這將允許您在txt. 例如:gettip(`This 'string' can include "quotes"`)

對(duì)于您的情況:

onmouseover="gettip(`<img src='Images/homeworkpreview.jpg'><br><br><b>Due:</b> January 27 <br> <b>Points:</b> 50 <br> <br> <b> Description: </b> <br> Create a Homework page with a table with information about the projects for this semester. This will act as the hub for all of your projects to be linked to.`)"

注意:這適用于約 95% 的用戶。如果您需要更多報(bào)道,您可以按照此處的其他答案指示轉(zhuǎn)義引號(hào)。


查看完整回答
反對(duì) 回復(fù) 2022-06-16
?
米脂

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超3個(gè)贊

轉(zhuǎn)義單引號(hào)后,您需要一些帶有 id 的元素info,例如:


function gettip(txt) {

  document.getElementById("info").innerHTML = txt;

}


function reset() {

  document.getElementById("info").innerHTML =

    "Roll over a link for information on the project! ";

}

<a href="Homework.html" onmouseover="gettip('<img src=\'Images/homeworkpreview.jpg\'><br><br><b>Due:</b> January 27 <br> <b>Points:</b> 50 <br> <br> <b> Description: </b> <br> Create a Homework page with a table with information about the projects for this semester. This will act as the hub for all of your projects to be linked to.')"

  onmouseout="reset()">

      Homework

    </a>

<div id="info"></div>


查看完整回答
反對(duì) 回復(fù) 2022-06-16
  • 2 回答
  • 0 關(guān)注
  • 166 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)