下面是jquery的实现代码:复制代码 代码如下: $(document).ready(function(){ $('pre').hover( function(){ if($(this).width()==520){ $(this).animate({width:'800'},400); $(this).css({border:'1px solid #2B99E6'}); } }, function(){ if($(this).width()==800){ $(this).animate({width:'520'},400); $(this).css({border:'1px solid #555555'}); } } );
推荐阅读
createElement与createDocumentFragment的点点区别小结
网上可以搜到的大部分都是说使用createDocumentFragment主要是因为避免因createElement多次添加到document.body引起的效率问题,比如: 复制代码 代码如下: var arrText=["1","2","3","4","5","6","7","8","9","10>>>详细阅读
本文标题:基于jquery的代码显示区域自动拉长效果
地址:http://www.17bianji.com/kaifa2/JS/23844.html
1/2 1