javascript£»Æ´Í¼ÓÎÏ·£¨¿É×ÔѡͼƬºÍÉèÖÃÐÐÁÐÊý£©
˼·£ºä¯ÀÀͼƬ£¬¶ÁÈ¡Æä¿í¶ÈImageW£¬¸ß¶ÈÖµImageH¡£¶ÁÈ¡Óû§ÊäÈëµÄ·Ö³É¼¸ÐÐRow¼¸ÁÐCol¡£
ÿ¸ö·½¿é£ºboxW=ImageW/Col£»boxH=ImageH/Row£»
ÔÚ1µ½Row*ColÖÐËæ»ú£¬µÚi¸öͼƬµÄλÖÃÉèΪpos¡¾i¡¿¡£È»ºó¶¯Ì¬´´½¨divÉú³ÉRow*Col¸ö£¬ÆäλÖøù¾Ýpos¡¾i¡¿Ë㣬Æä±³¾°Í¼Æ¬¸ù¾ÝiË㣬ÕâÖмäÿ¸ödivÊÇÏÔʾ²¿·ÖͼƬ£¬ËùÒÔÓõ½backgroundPosition£¬ÆäÖµÒ²µÄ¸ù¾ÝiËã¡£
divÉú³ÉºÃºó£¬¾ÍÊǸù¾Ý¼üÅÌÉÏϼüÒƶ¯·½¿éÀ²¡£
Ö÷ÒªÒÀ¾Ý¿Õ¸ñ·½¿éµÄλÖã¬ÔÚ¸ù¾Ýevent.keyCodeµÄÖµ£¬ÅжÏÊÇÉÏÏÂ×óÓÒÖÐÄÄÒ»¸ö¡£ÅжÏÍêºó£¬ÔÙÅжÏÔÚµ±Ç°·½Ïò¼üÏ£¬¿Õ¸ñÄÜ·ñÒƶ¯£¬²»ÐУ¬Ôòɶ¶¼²»×ö¡£ÈôÄÜÒƶ¯£¬Ôò¸ù¾Ýdiv.styleµÄtopºÍleftÊôÐÔ£¬Òƶ¯¿Õ¸ñ¿éÒÔ¼°ËüÒªÒƶ¯µ½µÄÄǸö·½¿é¡£²¢±£´æ¿Õ¸ñ¿éµÄÊôÐÔºÍλÖã¬ÒÔ¼°ÄǸö·½¿éµÄÊôÐÔºÍλÖá£
µ±i=pos¡¾i¡¿Ê±£¬¼´Ã¿¸ö·½¿é¶¼·ÅÔÚ¶ÔӦλÖÃÉÏ£¬ÌáʾÐÅÏ¢-----congratulations£¡
ÏÂÃæÌùÉϲ¿·Ö´úÂ룺
<input type="file" id="file" style="display:none" \>
<input type="button" value="Ñ¡ÔñͼƬ" onclick="ok()" \><br />
ÄãÏë°ÑͼƬ·Ö³É¼¸Ðм°ÁÐÄØ:<br />ÐÐÊý:<input type="text" id="row" \ /><br />
ÁÐÊý:<input type="text" id="col" \ /><br />
<input type="button" value="Go" onclick="Run()" \><br />
ÆäÖУ¬RunʵÏÖÈë¿Ú¿ªÊ¼·ÅÖÃdiv£¬OK£¨£©ÊµÏÖ¶ÁȡͼƬ£¬´æÈ¡Ïà¹ØÊôÐÔ¡£µ±È»»¹ÓÐÑéÖ¤µÈ¡£
/»ñÈ¡ÉèÖõÄÐÐÊýºÍÁÐÊý,²¢¿ªÊ¼ÓÎÏ·
function Run() {
Row = parseInt(row.value.toString());
Col = parseInt(col.value.toString());
boxH = ImgHeight / Row;
boxW = ImgWidth / Col;
blank_pos = Row * Col;
//generateL(Col * Row);
start();
}
function start() {
initPic();//alert(nam.length);
document.onkeydown = keyDown;//Êó±êÉÏÏÂ×óÓÒÍæÓÎÏ·µÄ¿ØÖÆ
}
//²úÉúRow*Col-1¸öͼƬµÄËæ»úλÖÃ
function initPic() {
&n
Ïà¹ØÎĵµ£º
//ºǫ́CSµ÷ÓÃǰ̨JS·½·¨
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script>CheckInput()</script>");
//УÑéÊäÈë¿òÊÇ·ñΪ¿Õ£¬Ð£ÑéÊÇ·ñÊÇÊý×Ö
<script type="text/javascript" language="javascript">
function CheckInput ......
¶þÊ®¡¢Bookmarklet
1¡¢Ê²Ã´ÊÇBookmarklet£¿£¨What's a Bookmarklet?£©
Q£ºÊ²Ã´ÊÇBookmarklet£¿
A£ºBookmarkletÊÇÕû¸ö¶¼±»°üº¬ÔÚ³¬Á´½ÓURLÖеÄһС¶ÎJavaScript³ÌÐò¡££¨JavaScript URL¾ÍÊÇÕâ¸öÑù×Ó£º<a href="javascript:the code goes here">¡££©¶àÊýä¯ÀÀÆ÷ÔÊÐíÓû§Ìí¼ÓÕâЩJavaScript URLÊéÇ©£¬¾ÍÏñÌí¼ÓÆäËû³¬Á´½ ......
Óï·¨
oNewWindow = window.open( [sURL] [, sName] [, sFeatures] )
sURL ¿ÉÑ¡. URL ×Ö·û´® . Èç¹ûURLΪ¿Õ, ½«ÒÔabout:blank´ò¿ª.
sName ¿ÉÑ¡. ×Ö·û´® ÃèÊö´ò¿ª´°¿ÚµÄÃû×Ö(name). ¿ÉÒÔ×öΪform ºÍ a ±êÇ©µÄTARGETÊôÐÔÖµ .
sFeatures ¿ÉÑ¡. ×Ö·û´® ¸ñʽÈç"fullscreen=yes,toolbar=yes".channelmode = { yes | no | ......
ÎļþÄÚÈÝÈçÏ£º£¨Á½¸öÎļþglossy.jsºÍglossy.html£©
/********************************** glossy.js ***********************************/
/**
* glossy.js 1.31 (19-Jul-2007)
* (c) by Christian Effenberger
* All Rights Reserved
* Source: glossy.netzgesta.de
* Distrib ......
ÄãÖªµÀÊÀ½çÉÏÓжàÉÙÖÖä¯ÀÀÆ÷Â𣿳ýÁËÎÒÃÇÊìÖªµÄIE, Firefox, Opera, SafariËÄ´óä¯ÀÀÆ÷Ö®Í⣬ÊÀ½çÉÏ»¹Óнü°ÙÖÖä¯ÀÀÆ÷¡£
¼¸ÌìÇ°£¬ä¯ÀÀÆ÷¼Ò×åÓиյ®ÉúÁËһλСÍõ×Ó£¬¾ÍÊÇGoogleÍƳöµÄChromeä¯ÀÀÆ÷¡£ÓÉÓÚChrome³öÉúÃûÃÅ£¬¾¡¹ÜËû»¹ÊǸöС¼Ò»ï£¬Ã»ÓÐÈ˸ÒС ......