Home  >  Article  >  Web Front-end  >  Code display area automatically lengthened effect based on jquery_jquery

Code display area automatically lengthened effect based on jquery_jquery

WBOY
WBOYOriginal
2016-05-16 17:58:351136browse

The following is the implementation code of jquery:

Copy the code The code is as follows:

$(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'});
}
}
);
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn