摘要:   阅读全文
posted @ 2008-08-11 21:15 S.Sams 阅读(15) | 评论 (0)编辑

非常讨厌在网页写文章, 写了半又没了, 又得重头来. 发下牢骚, 接着来!


实现功能:

     1. Tooltip

     2. Validate 表单验证

 

     可分开独立使用    

 

     您可以不写一行代码, 只需设置验证规则即可

 

     其实园子已经存在不少基于jQuery的验证插件, 如: http://www.cnblogs.com/wzmaodong/archive/2008/05/21/1203962.html

但感觉使用起来过于麻烦, 要实现在大堆表单的验证, javascript 代码一大堆. 所以这里的设计原则就是使用便捷, 易维护, 同时适应性大.

在验证中使用了自定义正则表达式, 这样用起来就非常方便了.  先看下最后的效果图

 

     1. 即时表单验证和提示

      

 

     2.  提交表单时验证

       

 

     下面看下我们如何在 asp.net 中实现便捷的提示功能和表单验证功能

     

 

 

Code

 

 

 

 以上的实现是不是很方便, 不用写大堆的 javascript 逻辑代码便可轻松实现验证和提示功能

 

通过调用 $(document).ready(function() {jQuery('input[tip],input[reg]').tooltip({onsubmit: true})}); 便完成数据的验证和提示功能. (该调用已集成在tooltip.js中)

onsubmit: true 这里设置是否触发 onsubmit 的提交验证事件.

 

再看看 CSS 的实现

 

 

 

.tooltipinputerr
{
    padding
: 2px 0 2px 18px;
    border
: solid 1px red;
    background
: #ffff99 url(/images/exclamation.png) no-repeat 2px center;
    
}

    
.tooltipinputok
{
    padding
: 2px 0 2px 18px;
    border
: solid 1px green;
    background
: url(/images/accept.png) no-repeat 2px center;
    
}

    
.tooltipshowpanel
{
    z-index
: auto;
    display
: none;
    position
:absolute;
    width
: 276px;
    height
: 35px;
    overflow
: hidden;
    text-indent
: 5px;
    line-height
: 40px;
    font-size
: 12px;
    font-family
: Arial;
    background
: url(/images/tooltop.gif) no-repeat left top;
    opacity
:0.9;
    filter
: alpha(opacity=90);
    
}

 

 

 

 

 使用方法:

     一.

Download jQuery

  二. 加入以上样式和引用tooltip.js文件

      

Tooltip.pack.js 1KB 0 2008/8/6 22:41:16
Tooltip.mini.js 1KB 0 2008/8/6 22:41:11
Tooltip.js 3KB 0 2008/8/6 22:41:04

 

 

 完整Demo下载  jquery-tooltip.rar 

 

     支持 Select Demo jquery-tooltip_select.rar

 

 

 版本更新下载: TooltipAndRegex.rar

 

posted @ 2008-08-07 00:09 S.Sams 阅读(2709) | 评论 (33)编辑

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 阅读(249) | 评论 (1)编辑
posted @ 2008-07-22 11:52 S.Sams 阅读(103) | 评论 (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 阅读(408) | 评论 (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 阅读(76) | 评论 (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 阅读(39) | 评论 (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 阅读(114) | 评论 (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 阅读(24) | 评论 (0)编辑