javascript控制flash动画
一、介绍与Flash动画控制有关的javascript函数:
函数名 使用 作用
play() wgzc.play() 播放Flash动画
stopplay() wgzc.stopplay() 停止播放Flash动画
rewind() wgzc.rewind() 停止播放Flash动画并返回第一帧
totalframes() wgzc.totalframes() 返回Flash动画总帧数
gotoframe(int num) wgzc.gotoframe(int num) 转到指定帧
注:wgzc是flash的id
二、程序代码:
<html>
<head>
<script language="javascript">
function init()
{ document.changeframe.totalfrm.value=document.wgzc.totalframes }
</script>
</head>
<body onload="init()" bgcolor="#FFFFFF" bgproperties="fixed">
<fieldset>
<legend><font color="
相关文档:
原文:《Speeding up JavaScript: Working with the DOM》
作者: KeeKim Heng, Google Web Developer
在我们开发互联网富应用(RIA)时,我们经常写一些javascript脚本来修改或者增加页面元素,这些工作最终是DOM——或者说文档对象模型——来完成的,而我们的实现方式会影响到应用的响应速度。
DO ......
<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" onmouseup=document.selection.empty() oncopy=document.selection.empty() onselect=document.selection.empty()></body>
讲上面红色显示的插入到网页中就可以实现鼠标右击无效
......
在上传操作中,经常会遇到要求指定上传文件的格式,下面的实例是在客户端通过JavaScript验证上传图片格式为jpg/gif/png
<html>
<head>
<mce:script language="JavaScript" type="text/JavaScript"><!--
var img=null;
function checkPic(picForm){
var location=picForm.pic.v ......
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="return f ......
reg = /^((((((0[48])|([13579][26])|([2468][048]))00)|([0-9][0-9]((0[48])|([13579][26])|([2468][048]))))-02-29)|(((000[1-9])|(00[1-9][0-9])|(0[1-9][0-9][0-9])|([1-9][0-9][0-9][0-9]))-((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30))|(((0[1-9])|(1[0-2]))-((0[1-9])|(1[0-9])|(2[0-8]))))))$/i; ......