ÍêÃÀµÄËõ·ÅͼƬµÄ javascript ´úÂë¡£
ÔÚ×öÍøÕ¾µÄʱºò£¬ÎÒÃǾ³£ÐèÒª¶Ô³ß´ç³¬±êµÄͼƬ½øÐÐËõ·Å¡£
ÓÉÓÚä¯ÀÀÆ÷µÄ²îÒ죬ÓÐЩ´úÂëijЩä¯ÀÀÆ÷¹¤×÷²»Õý³£¡£
¾¹ýÑо¿µÃµ½ÁËÒÔϵĴúÂ룬Ëü¿ÉÒÔÔÚIE6,IE8,FireFoxÖÐÍêÃÀµØ°´±ÈÀýËõ·ÅͼƬ¶ø²»Ê§Õæ¡£
//¸Ä±äͼƬ´óС
function resizepic(o)
{
var maxwidth=550; //¶¨Òå×î´ó¿í¶È
var maxheight=800; //¶¨Òå×î´ó¸ß¶È
var a=new Image();
a.src=o.src
if( a.width<1 || a.height<1 )
return;
var f1 = 1.0*maxwidth/a.width
var f2 = 1.0*maxheight/a.height
if(a.width > maxwidth && f1<f2)
{
o.style.width=maxwidth;
}
if (a.height> maxheight && f1>=f2 )
{
o.style.height=maxheight;
}
}
Ïà¹ØÎĵµ£º
function testExe(entityId, wfId) {
var id = crmForm.ObjectId;
var xml = "" +
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http:/ ......
À´Ô´£ºhttp://blog.csdn.net/yjq8116/archive/2008/11/04/3219993.aspx
·½·¨Ö÷ÒªÓÐÈýÖÖ
ת»»º¯Êý¡¢Ç¿ÖÆÀàÐÍת»»¡¢ÀûÓÃjs±äÁ¿ÈõÀàÐÍת»»¡£
1. ת»»º¯Êý
jsÌṩÁËparseInt()ºÍparseFloat()Á½¸öת»»º¯Êý¡£Ç°Õß°Ñֵת»»³ÉÕûÊý£¬ºóÕß°Ñֵת»»³É¸¡µãÊý¡£Ö»ÓжÔStringÀàÐ͵÷ÓÃÕâЩ·½·¨£¬ÕâÁ½¸öº¯Êý²ÅÄÜÕýÈ·ÔËÐУ»¶ÔÆäËûÀàÐÍ·µ» ......
·½·¨Ö÷ÒªÓÐÈýÖÖ
ת»»º¯Êý¡¢Ç¿ÖÆÀàÐÍת»»¡¢ÀûÓÃjs±äÁ¿ÈõÀàÐÍת»»¡£
1. ת»»º¯Êý
jsÌṩÁËparseInt()ºÍparseFloat()Á½¸öת»»º¯Êý¡£Ç°Õß°Ñֵת»»³ÉÕûÊý£¬ºóÕß°Ñֵת»»³É¸¡µãÊý¡£Ö»ÓжÔStringÀàÐ͵÷ÓÃÕâЩ·½·¨£¬ÕâÁ½¸öº¯Êý²ÅÄÜÕýÈ·ÔËÐУ»¶ÔÆäËûÀàÐÍ·µ»ØµÄ¶¼ÊÇNaN(Not a Number)¡£
ÔÚÅжÏ×Ö·û´®ÊÇ·ñÊÇÊý×Öֵǰ£¬parseInt()ºÍ ......