今天早上的成果,javascript菜單原理和flash中庫檔案匯入到情境中

來源:互聯網
上載者:User
今天早上解決了以前困過了我的一個問題(稍後講解)。。還有昨天的flash庫檔案匯入到情境mc中。。 先來說說flash中庫裡的檔案,如何匯入到情境的Mc中?其實以前會的,腦子看來是老了,這麼簡單的問題都被自己想了半天。步驟1:庫中建立一個MC,右鍵點【連結】勾上第一個方塊,起個名稱,比如kk步驟2:在情境中放個mc,起個名字,比如pp步驟3:在時間軸上寫:pp.attachMovie("kk","pp",1);問題解決了。。 今天早上還解決了一個以前弄了很長時間的問題,那就是javascript菜單原理,別的還好說,主要是你菜單DIV中方個A標記的話,當你滑鼠離開A標記的話會觸發DIV的onmouseout,結果就觸發了兩次,就不符合自己的要求了嗎,今天突然看到一個思路,就是把所有DIV裡面的元素包括DIV起個Class名,然後判斷如果是這個Class,就不隱藏菜單。代碼如下:<script language="javascript">
function showTip(oEvent)
{
 var oDiv = document.getElementById("mytip");
 oDiv.style.visibility = "visible";
 oDiv.style.left =oEvent.clientX - oEvent.offsetX - 2;
 oDiv.style.top = oEvent.clientY - oEvent.offsetY + 20;
}
function hideTip(oEvent)
{
 if (document.elementFromPoint(oEvent.x,oEvent.y).className!="ttt")
 {
  var oDiv = document.getElementById("mytip");
  oDiv.style.visibility = "hidden";
 }
}
function mystatic(it)
{
 window.status = event.offsetX + " : " +event.clientX;
}
</script>

 

<div style="background-color:red; width:300px; height:100px; position:absolute; visibility:hidden;" onmouseout="hideTip(event)" class="ttt" id="mytip">

<a class="ttt" href="http://www.zzcn.net/">站長中國</a>


</div>

<div onmouseover="showTip(event)" style="position:absolute;" id="ddd" onmousemove="mystatic(this)">mylink</div>

用這個可以做出來自己PS的菜單,效果就會多姿多彩了,再配合上彭彭的gif透明的javascript代碼,就可以做出來很牛的菜單啦。。呵呵。。文章引用自:

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.