If you want to make your webpage more cool and make your comments more interactive, then please study this code carefully.
jQuery code:
$(function(){
var $comment = $('#comment');
$('.bigger').click(function(){
If(!$comment.is(":animated")){
If($comment.height() < 500){
//$comment.height($comment.height() 50);
$comment.animate({height:" =50"},400);
}
});
$('.smaller').click(function(){
If(!$comment.is(":animated")){
If($comment.height() > 50){
//$comment.height($comment.height() - 50);
$comment.animate({height:"-=50"},400);
});
$('.up').click(function(){
If(!$comment.is(":animated")){
$comment.animate({scrollTop:"-=50"},400);
});
$('.down').click(function(){
If(!$comment.is(":animated")){
$comment.animate({scrollTop:" =50"},400);
});
});
HTML code:
Copy code
The code is as follows:
& Lt; span class = "bigger" & gt; zoom in & lt;/span & gt;
& Lt; span class = "smaller" & gt; reduction & lt;/span & gt;
& Lt; span class = "up" & gt; up & lt;/span & gt;
Down
CSS code:
Copy code
}
The code is here. I won’t go into details about how to use it and where to use it. Friends, feel free to use it.
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