如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
1、调整图片大小,不走形(FFIE兼容)2、控制textarea区域文字数量3、点击显示新窗口4、input框自动随内容自动变长5、添加收藏夹6、设置首页7、Jquery+Ajax判断用户是否存在8、判断email格式是否正确9、综合判断用户名(长度,英文字段等)10、新闻滚动11、只允许输入正整数(shoppingcart使用)12、转换字符串为数字13、判断文件格式(获得文件后缀)14、截取字符串15、分割字符串1、调整图片大小,不走形(FFIE兼容)Js代码//用法<imgsrc="this_image_path.jpg"onload="DrawImage(this,450,450);"/>functionDrawImage(ImgD,FitWidth,FitHeight){varimage=newImage();image.src=ImgD.src;if(image.width>0&&image.height>0){if(image.width/image.height>=FitWidth/FitHeight){if(image.width>FitWidth){ImgD.width=FitWidth;ImgD.height=(image.height*FitWidth)/image.width;}else{ImgD.width=image.width;ImgD.height=image.height;}}else{if(image.height>FitHeight){ImgD.height=FitHeight;ImgD.width=(image.width*FitHeight)/image.height;}else{ImgD.width=image.width;ImgD.height=image.height;}}}}//用法<imgsrc="this_image_path.jpg"onload="DrawImage(this,450,450);"/>functionDrawImage(ImgD,FitWidth,FitHeight){varimage=newImage();image.src=ImgD.src;if(image.width>0&&image.height>0){if(image.width/image.height>=FitWidth/FitHeight){if(image.width>FitWidth){ImgD.width=FitWidth;ImgD.height=(image.height*FitWidth)/image.width;}else{ImgD.width=image.width;ImgD.height=image.height;}}else{if(image.height>FitHeight){ImgD.height=FitHeight;ImgD.width=(image.width*FitHeight)/image.height;}else{ImgD.width=image.width;ImgD.height=image.height;}}}}2、控制textarea区域文字数量Js代码//eg:<textareaid="sms"name="sms"maxlength="50"onkeyup="getLength(document.getElementById('sms').value,50);"></textarea><pid="p1"></p>vartemp;functiongetLength(content,length){temp=content;vartext=content.replace(/[^\x00-\xff]/g,"**");varlength1=text.length;if(length>=length1){document.getElementById("p1").innerHTML="Remainingcharactercount:"+(length-length1);}else{document.getElementById('sms').value=getShortForm(document.getElementById('sms').value,length,"");document.getElementById("p