当前位置:Gxlcms > JavaScript > 基于jquery的代码显示区域自动拉长效果

基于jquery的代码显示区域自动拉长效果

时间:2021-07-01 10:21:17 帮助过:7人阅读

下面是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'});
}
}
);

人气教程排行