目前分類:JavaScript (6)

瀏覽方式: 標題列表 簡短摘要

The jQuery Media Plugin supports unobtrusive conversion of standard markup into rich media content.

It can be used to embed virtually any media type, including Flash, Quicktime, Windows Media Player, Real Player, MP3, Silverlight, PDF and more, into a web page.

The plugin converts an element (usually an) into a which holds the object, embed or iframe tags neccessary to render the media content.


hhc0629 發表在 痞客邦 留言(0) 人氣()

  1. 基本型

hhc0629 發表在 痞客邦 留言(0) 人氣()

先來看一下範例:

在這範例中,若要取得 form 裡面的 text 的元素的話,相信應該是很多人都會用 document.all("text1") 或是用 document.form1.text1 吧!在 IE 、 FireFox 及 Opera 中,以上兩種寫法都是可以執行的,但要注意的是: document.all 並非是標準的寫法

hhc0629 發表在 痞客邦 留言(0) 人氣()

以下以 IE 代替 Internet Explorer,以 MF 代替 Mozzila Firefox

1. document.form.item 問題
(1)現有問題:
現有程式碼中存在許多 document.formName.item("itemName") 這樣的語法,不能在 MF 下執行
(2)解決方法:
改用 document.formName.elements["elementName"]
(3)其它
參見 2

hhc0629 發表在 痞客邦 留言(0) 人氣()

Use this javascript function in your frame page..

"
function resizeIframe(iframeID) {
if(self==parent) return false; /* Checks that page is in iframe. */
else if(document.getElementById&&document.all) /* Sniffs for IE5+.*/

var FramePageHeight = framePage.scrollHeight + 10; /* framePage
is the ID of the framed page's BODY tag. The added 10 pixels prevent an
unnecessary scrollbar. */

parent.document.getElementById(iframeID).style.height=FramePageHeight;
/* "iframeID" is the ID of the inline frame in the parent page. */
}
"
and run it on load

"<body id="framePage" onload="resizeIframe('idTopFrame')">"

hhc0629 發表在 痞客邦 留言(0) 人氣()

// It is safe to remove this comment in production...
<head><title>Container</title>
<script language="JavaScript">
function iFrameHeight() {
if(document.getElementById && !(document.all)) {
h = document.getElementById('iframename').contentDocument.body.scrollHeight;
document.getElementById('iframename').style.height = h;
}
else if(document.all) {
h = document.frames('iframename').document.body.scrollHeight;
document.all.iframename.style.height = h;
}
}
</script>
</head>
<iframe onLoad="iFrameHeight();" src="http://localhost/" scrolling="no" scroll="no" id="iframename" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>
</body>
</html>

hhc0629 發表在 痞客邦 留言(0) 人氣()