javascript拼图游戏
拼图游戏,在ie7 ,火狐,谷歌 测试通过。
HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
var mapBlock=3; //3 * 3 个单元格
var mapWH=300; //地图的大小
var tabobj;
var imgsrc="http://i3.6.cn/cvbnm/35/b7/8f/4e78358bc9f1b80a62a749d04bf409d8.jpg";
var backgroundPositionArr;
function createMap()
{
backgroundPositionArr=new Array();
document.getElementById("imgid").src=imgsrc;
tabobj=document.createElement("table");
tabobj.style.width=mapWH+"px";
tabobj.style.height=mapWH+"px";
tabobj.border="0";
tabobj.cellspacing="0";
tabobj.style.backgroundColor="rgb(223,223,223)";
 
相关文档:
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=" ......
<script type="text/javascript">
function getFileSize(filePath) {
var image=new Image();
image.dynsrc=filePath;
alert(image.fileSize);
}
</script> &nbs ......
//设置当前页面为用户的首页
function setHomepage()
{
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage(window.location.href);
event.returnValue=false;
return;
}
//加入收藏
function addFavorite()
{
&nb ......
Javascript中常用的经典技巧
1. oncontextmenu="window.event.returnValue=false"
将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table>
可用于Table
2. <body onselectstart="return false">
取消选取、防止复制
3. onpaste=&quo ......