http://lab.berkerpeksag.com/jGrow

What is jGrow?

jGrow is a jQuery plug-in that makes the textarea adjust its size according to the length of the text.

It works smoothly with jQuery 1.2.x. It was tested on IE6/7, Firefox 2.0.x and Opera 9.x, and no bug was spotted yet.

非常好一个jQuery插件, 但原版不支持 Ctrl + V 的键盘操作事件, 直接代码.

 /* 原版代码.
 * jGrow 0.2
 * 08.02.2008
 * 0.2 release: 04.03.2008
 */
 
 (function($) {

  $.fn.jGrow = function(options) {

   var opts = $.extend({}, $.fn.jGrow.defaults, options);

   return this.each(function() {

    $(this).css({ overflow: "hidden" }).bind("keypress", function() {

     $this = $(this);

     var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

     if(o.rows == 0 && (this.scrollHeight > this.clientHeight)) {
      
      this.rows += 1;
      
     } else if((this.rows <= o.rows) && (this.scrollHeight > this.clientHeight)) {

      this.rows += 1;

     } else if(o.rows != 0 && this.rows > o.rows) {

      $this.css({ overflow: "auto" });

     }

     $this.html();

    });

   });

  }

  $.fn.jGrow.defaults = { rows: 0 };

 })(jQuery);

 

以下为改进后的代码, 支持 Ctrl+V 键盘事件操作

 /*
 * jGrow 0.2
 * 08.02.2008
 * 0.2 release: 04.03.2008
 */
 
 // Updated by S.Sams 2008-07-24 21:47 以兼容Ctrl+V的操作
 
 (function($) {

  $.fn.jGrow = function(options) {

   var opts = $.extend({}, $.fn.jGrow.defaults, options);

   return this.each(function() {
   
    var isCtrl = false;
    
    $(this).css({ overflow: "hidden" }).bind("keypress", function() {
    
        $this = $(this);
       
     var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

     if(o.rows == 0 && (this.scrollHeight > this.clientHeight)) {
      
      this.rows += 1;
      
     } else if((this.rows <= o.rows) && (this.scrollHeight > this.clientHeight)) {

      this.rows += 1;

     } else if(o.rows != 0 && this.rows > o.rows) {

      $this.css({ overflow: "auto" });

     }

     $this.html();

    }).bind("keydown",function(event){
    
        if(event.keyCode == 17) isCtrl = true;
          
    }).bind("keyup",function(event){

        if(isCtrl && event.keyCode == 86)
        {
         var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
            var getCL = this.value.split('\n').length
         if( getCL <= o.rows)
         {
             this.rows = getCL;
         }
         else
         {
             this.rows = o.rows;
             $(this).css({ overflow: "auto" });
         }
         isCtrl = false;
     }
    });

   });

  }

  $.fn.jGrow.defaults = { rows: 0 };

 })(jQuery);

 

 // 自适应 textarea 有内容存在的高度自动调整

 /*
 * jGrow 0.2
 * 08.02.2008
 * 0.2 release: 04.03.2008
 */

 // Updated by S.Sams 2008-07-24 21:47 以兼容Ctrl+V的操作

 (function($) {

  $.fn.jGrow = function(options) {

   var opts = $.extend({}, $.fn.jGrow.defaults, options);

   return this.each(function() {

    var isCtrl = false;

    $(this).css({ overflow: "hidden" }).bind("keypress", function() {

        $this = $(this);

     var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

     if(o.rows == 0 && (this.scrollHeight > this.clientHeight)) {

      this.rows += 1;

     } else if((this.rows <= o.rows) && (this.scrollHeight > this.clientHeight)) {

      this.rows += 1;

     } else if(o.rows != 0 && this.rows > o.rows) {

      $this.css({ overflow: "auto" });

     }

     $this.html();

    }).bind("keydown",function(event){

        if(event.keyCode == 17) isCtrl = true;

    }).bind("keyup",function(event){

        if(isCtrl && event.keyCode == 86)
        {
         var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
            var getCL = this.value.split('\n').length
         if( getCL <= o.rows)
         {
             if(getCL > parseInt(this.rows))
                 this.rows = getCL;
         }
         else
         {
             this.rows = o.rows;
             $(this).css({ overflow: "auto" });
         }
         isCtrl = false;
     }
    });

    // Updated by S.Sams 2008-07-25
    // 修正 testarea 有内容存在的情况下的自动调整高度
    if($(this).val().length > 0)
    {
     var o = $.meta ? $.extend({}, opts, $(this).data()) : opts;
     var getCL = this.value.split('\n').length
     if( getCL <= o.rows)
     {
      if(getCL > parseInt(this.rows))
       this.rows = getCL;
     }
     else
     {
      this.rows = o.rows;
      $(this).css({ overflow: "auto" });
     }
    }

   });

  }

  $.fn.jGrow.defaults = { rows: 0 };

 })(jQuery);

posted @ 2008-07-24 21:57 S.Sams 阅读(51) | 评论 (0)编辑
//函数名:strByteLength
//功能介绍:返回字符串的字节长度
//参数说明:str    要检查的字符串
//返回值:字符串长度
function strByteLength(str)
{
    var i,sum;
    sum=0;
    for(i=0;i<str.length;i++)
    {
        if ((str.charCodeAt(i)>=0) && (str.charCodeAt(i)<=255))
            sum=sum+1;
        else
            sum=sum+2;
    }
    return sum;
}

//函数名:fucCheckLength
//功能介绍:检查表单是否符合规定的长度
//参数说明:obj    要检查的表单对象
//        name   对象名称
//        length 规定长度
//返回值:true(符合) or false(不符)  
function fucCheckLength(obj , name , length)
{
    var i,sum;
    sum=0;
    var strTemp = obj.value;
    for(i=0;i<strTemp.length;i++)
    {
        if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
            sum=sum+1;
        else
            sum=sum+2;
    }
    if(sum<=length)
    {
        return true;
    }
    else
    {
        alert(name+"超出规定长度!最长允许"+length+"个字符(中文算2位)!");
        obj.focus();
        return false;
    }
}

//检测电子邮件是否合法
function checkEmail(Object)
{
    var pattern = /^[.-_A-Za-z0-9]+@([-_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
    var strValue=Object.value;
    if(strValue.match(pattern)==null){
       alert("Email不合法,请重新填写!");
       Object.focus();
        return false;
     }else{
     return true;
     }
}


//去空隔函数
function Jtrim(str){
    var i = 0;
    var len = str.length;
    if ( str == "" ) return( str );
    j = len -1;
    flagbegin = true;
    flagend = true;
    while ( flagbegin == true && i< len){
        if ( str.charAt(i) == " " ){
            i=i+1;
            flagbegin=true;
        }else{
            flagbegin=false;
        }
    }

    while  (flagend== true && j>=0){
        if (str.charAt(j)==" "){
            j=j-1;
            flagend=true;
        }else{
            flagend=false;
        }
    }

    if ( i > j ) return ("")

    trimstr = str.substring(i,j+1);
    return trimstr;
}

//函数名:JtrimCn
//功能介绍:去掉字符串前后的空格[包括中文空格]
//参数说明:str    要操作的字符串
//返回值:删除了前后空格[包括中文空格]的字符串
function JtrimCn(str){
    var i = 0;

    if (str == null || str == undefined) {
        return "";
    }

    var len = str.length;
    if ( str == "" ) {
        return( str );
    }
    j = len -1;
    flagbegin = true;
    flagend = true;
    while ( flagbegin == true && i< len){
        if ( str.charAt(i) == " " || str.charAt(i) == " " ){
            i=i+1;
            flagbegin=true;
        }else{
            flagbegin=false;
        }
    }

    while  (flagend== true && j>=0){
        if (str.charAt(j)==" " || str.charAt(j) == " "){
            j=j-1;
            flagend=true;
        }else{
            flagend=false;
        }
    }

    if ( i > j ) {
        return ("")
    }
    var trimstr = str.substring(i,j+1);
    return trimstr;
}

//0-9,A-Z,a-z规范字符判断
function isChar(Str){
    var regu = "^([0-9a-zA-Z]+)$";
    var re = new RegExp(regu);
    if (Str.search(re) != -1){
        return true;
    }
    return false;
}

//判断是否数字
function IsNum(Str){
    var regu = "^([0-9]+)$";
    var re = new RegExp(regu);
    if (Str.search(re) != -1)
        return true;
    {
        return false;
    }
}

//函数名:funcIsNotEmpty
//功能介绍:检查字符串是否为空
//参数说明:str 字符串
//返回值:true:不为空    false:为空
function funcIsNotEmpty(str){
    var s = /\S/;
    if(str==null){
        return false;
    }
    return s.test(str);
}

//函数名:fucCheckLength
//功能介绍:检查表单是否符合规定的长度
//参数说明:objValue    要检查的表单对象的数值
//        name   对象名称
//        minLen 最小长度
//        maxLen 最大长度
//返回值:true(符合) or false(不符)  
function fucCheckLengthB(objValue , minLen , maxLen)
{
    var i,sum;
    sum=0;
    var strTemp = objValue;
    for(i=0;i<strTemp.length;i++)
    {
        if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
            sum=sum+1;
        else
            sum=sum+2;
    }
    if(sum<=maxLen && sum >= minLen)
    {
        return true;
    }
    else
    {
        return false;
    }
}

//sDate1和sDate2是2002-12-18格式
function funDateDiff(sDate1, sDate2){
    var aDate, oDate1, oDate2, iDays ;
    aDate = sDate1.split("-") ;
    //转换为12-18-2002格式
    oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
    aDate = sDate2.split("-") ;
    oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) ;
    //把相差的毫秒数转换为天数
    iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24);
    //如果开始时间小于结束时间
    if (sDate1 > sDate2)
    {
        return (-1 * iDays);
    }
    return iDays;
}

//检测电子邮件是否合法
function funcCheckEmail(strValue)
{
    var pattern = /^[.-_A-Za-z0-9]+@([-_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
    if(strValue.match(pattern)==null){
        return false;
     }else{
     return true;
     }
}

//函数名:fucCheckMaxLength
//功能介绍:检查表单是否符合规定的长度
//参数说明:objValue    要检查的表单对象的数值
//        name   对象数值
//        maxLen 最大长度
//返回值:true(符合) or false(不符)  
function fucCheckMaxLength(objValue , maxLen)
{
    return fucCheckLengthB(objValue, 0 ,maxLen );
}

//函数名:fucCheckMaxLength
//功能介绍:检查指定对象的数值是否符合规定的长度
//参数说明:objValue    要检查的表单对象的数值
//        name   对象
//        maxLen 最大长度
//返回值:true(符合) or false(不符)  
function fucCheckObjMaxLength(obj , maxLen)
{
    if (obj == null) {
        return false;
    }
    return fucCheckLengthB(obj.value, 0 ,maxLen );
}

//函数名:funcCheckInvalidChar
//功能介绍:判断指定的字段是否有非法字符<>
//参数说明:obj    要检查的表单对象
//返回值:true(没有) or false(有)  
function funcCheckInvalidChar(obj)
{
    if (obj == null || obj.value== "")
    {
        return true;
    }
    //alert(obj.value);
    var pattern = /[<>]/;
    if(pattern.test(obj.value)){
       return false;
        
     }else{
        return true;
     }
}

/**
 * 判断指定的ID的对象的最大长度是否正确
 * param: objId 对象ID
 *        maxLength  最大长度
 * return: true 正确 , false 不正确
 */
function lengthMaxCheckMsg(objId, maxLength, objName ,needFocus, showMsg) {
    //个人信息check
    var obj = document.getElementById(objId);
    if (!fucCheckObjMaxLength(obj, maxLength)) {
        if (showMsg == null || showMsg== "") {
            alert(objName + "最多只能输入" + (maxLength/2) + "个汉字(或" + maxLength + "个英文数字)");
        } else {
            alert(showMsg);
        }
        if (needFocus) {
            obj.focus();
        }
        return false;
    }
    return true;
}

/**
 * 判断指定的ID的对象的是否包含非法字符
 * param: objId 对象ID
 *        objName  对象的名称
 *        needFocus 是否需要设焦点
 *        showMsg 显示的错误消息
 * return: true 正确 , false 不正确
 */
function invalidCharCheckMsg(objId, objName,needFocus, showMsg) {
    //个人信息check
    var obj = document.getElementById(objId);

    if (!funcCheckInvalidChar(obj)) {
        if (showMsg == null || showMsg== "") {
            alert(objName + '中不能含有“<”或“>”');
        } else {
            alert(showMsg);
        }
        if (needFocus) {
            obj.focus();
        }
        return false;
    }
    return true;
}

/**
 * 判断指定的ID的对象是否为空
 * param: objId 对象ID
 *        objName  对象的名称
 *        needFocus 是否需要设焦点
 *        showMsg 显示的错误消息
 * return: true 不为空 , false 为空
 */
function emptyCheckMsg(objId, objName,needFocus, showMsg) {
    //个人信息check
    var obj = document.getElementById(objId);

    if (!funcIsNotEmpty(obj.value)) {
        if (showMsg == null || showMsg== "") {
            alert(objName + '不能为空!');
        } else {
            alert(showMsg);
        }
        if (needFocus) {
            obj.focus();
        }
        return false;
    }
    return true;
}

/*日期计算函数
 * date 2007-01-01
 * cnt  1 or -1
 * return 2007-01-02
 */
function getDate(date , cnt){
    if(date.length!=10){
        return "";
    }
    var dateArray = date.split("-")
    if(dateArray==null){
        return "";
    }
    var temDate = new Date(dateArray[0], dateArray[1]-1, dateArray[2]);
    var newDate = Date.UTC(temDate.getYear(),temDate.getMonth(),temDate.getDate())
    newDate = newDate + (cnt*24*60*60*1000);
    newDate = new Date(newDate);
    var month = newDate.getMonth()+1;
    var day =  newDate.getDate();
    if(Number(month)<10)
        month = "0"+month;
    if(Number(day)<10)
        day = "0"+day;
    var retDate = newDate.getYear() + "-" + month + "-" + day;
    return retDate;
}

//函数名:substringByByte
//功能介绍:截取字符串
//参数说明:objValue    要检查的表单对象的数值
//        length   要截取的长度[字节长度]
//返回值:截取得到的字符串  
function funcSubstringByByte(objValue ,length)
{
    var i,sum;
    sum=0;
    var strTemp = objValue;
    if (strTemp) {
        if (strTemp.length <= (Math.ceil(length / 2))) {
            return strTemp;
        }
        for(i=0;i<strTemp.length && sum <= length ;i++)
        {
            if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
                sum=sum+1;
            else
                sum=sum+2;
        }
        
        if (sum > length) {
            return strTemp.substring(0,i - 1);
        } else {
            return objValue;
        }
    }
    return "";
}

//函数名:encodeHtml
//功能介绍:替换关键字
//参数说明:str    要替换的数据
//返回值:替换之后的数值
function encodeHtml(str){
    if (str) {
        return   str.replace(/>/g,   '&gt;').replace(/</g,   '&lt;').replace(/\'/g,   '&#039;').replace(/\"/g,   '&quot;').replace(/\r/g,   '<br   />');   
    }
    return str;
}
//函数名:decodeHTML
//功能介绍:替换关键字
//参数说明:str    要替换的数据
//返回值:替换之后的数值
function decodeHTML(val) {
    //alert("val=" + val);
    if (!val) return val;
    var dst = val;
    dst.replace( "&#039;",'\'');
    /**
    dst.replace(/&nbsp;/g, " ");
    dst.replace(/&quot;/g, "\"");
    dst.replace(/&gt;/g, ">");
    dst.replace(/&lt;/g, "<");
    dst.replace(/&amp;/g, "&");
    dst.replace(/&#039;/g, "'");
    **/
    //alert("dst=" + dst);
    return dst;
}

posted @ 2008-07-18 13:02 S.Sams 阅读(236) | 评论 (0)编辑

http://mediacdn.hongkongdisneyland.com.cn/html/hkdlch_v0101/staticPages/iasw/China/video/mv.flv

It's a world of laughter
A world of tears
It's a world of hopes
And a world of fears
There's so much that we share
That it's time we're aware
It's a small world after all

There is just one moon
And one golden sun
And a smile means
Friendship to ev'ryone
Though the mountains divide
And the oceans are wide
It's a small world after all

It's a small world after all
It's a small world after all
It's a small world after all
It's a sm

小小世界(普通话)
这是欢乐美丽的小世界
这是甜美幸福的小世界
啊 我们来跳舞
我们歌唱 歌唱美丽的小世界

这是一个小小世界
这是一个小小世界
这是一个小小世界
这是小世界

这是欢乐美丽的小世界
这是甜美幸福的小世界
啊 我们来跳舞
我们歌唱 歌唱美丽的小世界

这是一个小小世界
这是一个小小世界
这是一个小小世界
这是小世界

posted @ 2008-06-17 00:40 S.Sams 阅读(45) | 评论 (0)编辑
  1. Content-Type : (这个~很无语的东西,每次都记不住,现查!Wiki)
              application/octet-stream           万金油型,什么文件都适合!
              application/x-zip-compressed      专门针对Zip文件的,但是在某些情况下有奇效,这个后面讲
  2. Content-Disposition : 此属性设置内容输出的方式和属性,不大会使,常用就两种操作方式,一个是inline,另一个就是attachment;在输出类型之后可以跟着一些参数,在操作下载的时候如果我们不希望我们输出的文件编程abc.aspx的名字,就要设置filename的参数项,其他的参数项有:creation-date,modification-date,read-date,size。这些内容在后面讲高级的下载输出时会用得到哦。
posted @ 2008-06-16 15:36 S.Sams 阅读(19) | 评论 (0)编辑

 微软Windows Server 2008实战攻略系列之十八:Windows Server 2008 高可用性配置实现

http://download.microsoft.com/download/f/5/d/f5dcda4f-fa19-449b-ba9b-7135003f209f/msft032808vxpm.zip

微软Windows Server 2008实战攻略系列之十七:分支机构安全防护和合规性遵循
http://download.microsoft.com/download/f/5/d/f5dcda4f-fa19-449b-ba9b-7135003f209f/msft032608vxpm.zip

微软Windows Server 2008实战攻略系列之十六:流媒体Media Service 配置和新特性介绍
http://download.microsoft.com/download/f/5/d/f5dcda4f-fa19-449b-ba9b-7135003f209f/msft032408vxpm.zip

微软Windows Server 2008实战攻略系列之十五:网络安全防护配置和应用
http://download.microsoft.com/download/0/6/5/065424c8-f0d0-4198-a884-b0f8bc7c9102/msft032108vxpm.zip

微软Windows Server 2008实战攻略系列之十四:终端服务新特性和配置应用
http://download.microsoft.com/download/b/7/b/b7be88cb-0b10-44d1-98dc-4fc3ebf7f590/msft031908vxpm.zip

微软Windows Server 2008实战攻略系列之十三:虚拟化基本实现和企业应用配置
http://download.microsoft.com/download/b/7/b/b7be88cb-0b10-44d1-98dc-4fc3ebf7f590/msft031708vxpm.zip

微软Windows Server 2008实战攻略系列之十二:证书服务器管理和配置使用
http://download.microsoft.com/download/6/c/5/6c5a7bbc-0b56-4243-9c9f-6df660c9af99/msft031408vxpm.zip

微软Windows Server 2008实战攻略系列之十一:IIS 7 配置和管理应用
http://download.microsoft.com/download/6/c/5/6c5a7bbc-0b56-4243-9c9f-6df660c9af99/msft031208vxpm.zip

微软Windows Server 2008实战攻略系列之十:Windows Server 2008 活动目录配置和实现
http://download.microsoft.com/download/6/c/5/6c5a7bbc-0b56-4243-9c9f-6df660c9af99/msft031008vxpm.zip

微软Windows Server 2008实战攻略系列之九:Server Core 配置和管理应用
http://download.microsoft.com/download/f/4/8/f483f5b3-0609-4305-99dd-1f2decacff43/msft030708vxpm.zip

微软Windows Server 2008实战攻略系列之八:Windows Server 2008 安装和部署
http://download.microsoft.com/download/f/4/8/f483f5b3-0609-4305-99dd-1f2decacff43/msft030508vxpm.zip

微软Windows Server 2008实战攻略系列之七:Windows Server 2008 高可用新特性概览
http://download.microsoft.com/download/f/4/8/f483f5b3-0609-4305-99dd-1f2decacff43/msft030308vxpm.zip

微软Windows Server 2008实战攻略系列之六:网络安全防护新特性概览
http://download.microsoft.com/download/4/d/8/4d8968f0-54de-4aea-aafc-0832878b5af7/msft022908vxpm.zip

微软Windows Server 2008实战攻略系列之五:IIS 7 新特性概览和场景应用
http://download.microsoft.com/download/4/d/8/4d8968f0-54de-4aea-aafc-0832878b5af7/msft022708vxpm.zip

微软Windows Server 2008实战攻略系列之四:微软虚拟化解决方案逐个数
http://download.microsoft.com/download/4/d/8/4d8968f0-54de-4aea-aafc-0832878b5af7/msft022508vxpm.zip

微软Windows Server 2008实战攻略系列之三:Windows Server 2008 活动目录新特性概览
http://download.microsoft.com/download/2/0/5/205f9964-ff7d-4a7e-b74d-08443f5336e2/msft022208vxpm.zip

微软Windows Server 2008实战攻略系列之二:Windows Server 2008 管理易用性新特性概览
http://download.microsoft.com/download/2/0/5/205f9964-ff7d-4a7e-b74d-08443f5336e2/msft022008vxpm.zip

微软Windows Server 2008实战攻略系列之一:Windows Server 2008 新特性概览
http://download.microsoft.com/download/2/0/5/205f9964-ff7d-4a7e-b74d-08443f5336e2/msft021808vxpm.zip

posted @ 2008-06-08 17:36 S.Sams 阅读(62) | 评论 (1)编辑

Earlier before I have written an article about current best CSS hacks which you can see here And now here’s the list of today’s most used CSS tricks – tips. I have added image examples for most of them because of critics on CSS hacks article. If you think I have missed any please let me know

1. Rounded corners without images

<div id=”container”>
<b class=”rtop”>
<b class=”r1″></b> <b class=”r2″></b> <b class=”r3″></b> <b class=”r4″></b>
</b>
<!–content goes here –>
<b class=”rbottom”>
<b class=”r4″></b> <b class=”r3″></b> <b class=”r2″></b> <b class=”r1″></b>
</b>
</div>

.rtop, .rbottom{display:block}
.rtop *, .rbottom *{display: block; height: 1px; overflow: hidden}
.r1{margin: 0 5px}
.r2{margin: 0 3px}
.r3{margin: 0 2px}
.r4{margin: 0 1px; height: 2px}

Rounded corners without images

2. Style your order list

<ol>
<li>
<p>This is line one</p>
</li>
<li>
<p>Here is line two</p>
</li>
<li>
<p>And last line</p>
</li>
</ol>

ol {
font: italic 1em Georgia, Times, serif;
color: #999999;
}

ol p {
font: normal .8em Arial, Helvetica, sans-serif;
color: #000000;
}

Style your order list

3. Tableless forms

<form>
<label for=”name”>Name</label>
<input id=”name” name=”name”><br>
<label for=”address”>Address</label>
<input id=”address” name=”address”><br>
<label for=”city”>City</label>
<input id=”city” name=”city”><br>
</form>

label,input {
display: block;
width: 150px;
float: left;
margin-bottom: 10px;
}

label {
text-align: right;
width: 75px;
padding-right: 20px;
}

br {
clear: left;
}

CSS Tableless forms

4. Double blockquote

blockquote:first-letter {
background: url(images/open-quote.gif) no-repeat left top;
padding-left: 18px;
font: italic 1.4em Georgia, “Times New Roman”, Times, serif;
}

Double blockquote

5. Gradient text effect

<h1><span></span>CSS Gradient Text</h1>

h1 {
font: bold 330%/100% “Lucida Grande”;
position: relative;
color: #464646;
}
h1 span {
background: url(gradient.png) repeat-x;
position: absolute;
display: block;
width: 100%;
height: 31px;
}

<!–[if lt IE 7]>
<style>
h1 span {
background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’gradient.png’, sizingMethod=’scale’);
}
</style>
<![endif]–>

Gradient text effect

6. Vertical centering with line-height

div{
height:100px;
}
div *{
margin:0;
}
div p{
line-height:100px;
}

<p>Content here</p>

Vertical centering with line-height

7. Rounded corners with images

<div class=”roundcont”>
<div class=”roundtop”>
<img src=”tl.gif” alt=”"
width=”15″ height=”15″ class=”corner”
style=”display: none” />
</div>

CONTENT

<div class=”roundbottom”>
<img src=”bl.gif” alt=”"
width=”15″ height=”15″ class=”corner”
style=”display: none” />
</div>
</div>

.roundcont {
width: 250px;
background-color: #f90;
color: #fff;
}

.roundcont p {
margin: 0 10px;
}

.roundtop {
background: url(tr.gif) no-repeat top right;
}

.roundbottom {
background: url(br.gif) no-repeat top right;
}

img.corner {
width: 15px;
height: 15px;
border: none;
display: block !important;
}

Rounded corners with images

8. Multiple class name

<img src=”image.gif” class=”class1 class2″ alt=”" />

.class1 { border:2px solid #666; }
.class2 {
padding:2px;
background:#ff0;
}

9. Center horizontally

<div id=”container”></div>

#container {
margin:0px auto;
}

Center horizontally

10. CSS Drop Caps

<p class=”introduction”> This paragraph has the class “introduction”. If your browser supports the pseudo-class “first-letter”, the first letter will be a drop-cap. </p>

p.introduction:first-letter {
font-size : 300%;
font-weight : bold;
float : left;
width : 1em;
}

CSS Drop Caps

11. Prevent line breaks in links, oversized content to brake

a{
white-space:nowrap;
}

#main{
overflow:hidden;
}

12. Show firefox scrollbar, remove textarea scrollbar in IE

html{
overflow:-moz-scrollbars-vertical;
}

textarea{
overflow:auto;
}

posted @ 2008-06-02 16:53 S.Sams 阅读(13) | 评论 (0)编辑
由于IIS6只能在请求被分配到Asp.Net引擎后才能发生重写操作, IIS7可以在 IIS 请求管道的任何地方执行一个HttpModule,

而且IIS7对于文件或文件夹的访问权限得重新设置.

以下是错误信息:

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /signin.aspx



如果是IIS7.0的运行环境, 添加该配置

<system.webServer>
<modules>
<!-- 您的自定义IIS重写模块操作--> 
    <add type="S.Sams.Framework.UrlRewriter.RewriterModule" name="RewriterModule" />
</modules>
</system.webServer>

问题即可解决!

摘引自ScottGu的Blog
<?xml version="1.0" encoding="UTF-8"?>

<configuration>

<configSections>
<section name="rewriter"
requirePermission="false"
type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</configSections>

<system.web>

<httpModules>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
</httpModules>

  </system.web>

<system.webServer>

<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule" />
</modules>

<validation validateIntegratedModeConfiguration="false" />

</system.webServer>

<rewriter>
<rewrite url="~/products/(.+)" to="~/products.aspx?category=$1" />
</rewriter>

</configuration>


 

posted @ 2008-04-12 14:51 S.Sams 阅读(1373) | 评论 (3)编辑
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\CSharp\Web\2052
直接下载模板文件

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\CSharp
直接下载该路径所有模板
posted @ 2008-03-26 15:57 S.Sams 阅读(58) | 评论 (0)编辑