Ê·ÉÏ×îÅ£X×î¼ò½àµÄJavascriptͼƬËõ·Å´úÂë
Ô´Â룺
function resize(img, width, height) {
(img.width > img.height)
? ((img.height = Math.min(height, width * img.height/img.width)) || (img.width = Math.min(width, img.width)))
: ((img.width = Math.min(width, height * img.width/img.height)) || (img.height = Math.min(height, img.height)));
}
ÉÔ΢ѹËõһϣº
function resize1(i,w,h){var a=i.width;var b=i.height;a>b?((i.height=Math.min(h,w*b/a))||(i.width=Math.min(w,a))):((i.width=Math.min(w,h*a/b))||(i.height = Math.min(h,b)));}
Ïà¹ØÎĵµ£º
replace
·½·¨
ÒÔÏÂÊÇjavascript
ÖеÄÀý×Ó
ÏÂÃæµÄʾÀýÑÝʾÁË replace
·½·¨½«µÚÒ»´Î³öÏֵĵ¥´Ê "The"
Ìæ»»Îªµ¥´Ê "A"
µÄÓ÷¨¡£
function ReplaceDemo(){
var r, re; & ......
ÔÚÍøÒ³Öж¯Ì¬ÔØÈëµÄ JavaScript ¶ÔÓÚÒ³ÃæÏÔʾµÄËÙ¶ÈÓ°ÏìÉõ¶à£¬²»µÃ²»×¢Ò⣡
ÓÈÆäÊǺܶàÈËϰ¹ß°Ñ JavaScript include дÔÚ <head> Çø¿éÖУ¬ÕâÑùÒ»À´×î´óµÄÎÊÌâ¾ÍÊÇ Browser ±ØÐëÒªµÈµ½ JavaScript È«²¿¶ÁÍêºó²Å»á¿ªÊ¼ÏÔÊ¾ÍøÒ³£¬Èç¹ûÄãÏñÐÅÒå·¿ÎÝÕâÑù£¬¶ÁÒ»¸öÊ×Ò³ÒªÏÂÔØ 18 ¸ö JavaScript ÍⲿµµÇÒ¡¸Ã»ÓÐ´óÆµ¿í¡¹µÄ» ......
<input type=button onclick="aaa();" value="È·¶¨">
<iframe name="frame1">
<script language=javascript>
function aaa()
{
docume ......
javascriptÖÐinnerHtmlÓ÷¨
2009-04-21 22:52
<html>
<head>
<script language="javascript">
function Test(){
var str="";
str+="Hello,";
str+="This ......