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

Code display area automatically lengthened effect based on jquery_jquery

WBOY
Release: 2016-05-16 17:58:35
Original
1186 people have browsed it

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'});
}
}
);
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template