首頁  >  文章  >  web前端  >  基于jquery的代码显示区域自动拉长效果_jquery

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

WBOY
WBOY原創
2016-05-16 17:58:351136瀏覽

下面是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'});
}
}
);
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn