標籤:網站 style 內容 lin 應用 class str log double
多行文字框應用之高度變化
HTML:
<!--表單-多行文字框應用-高度變化--><!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <link type="text/css" href="01.css" rel="stylesheet"/> <script type="text/javascript" src="jquery.js"></script> </head> <body> <div class="he"> <span class="big">放大</span> <span class="small">縮小</span> </div> <div class="content"> <textarea class="cc" rows="10" cols="40"> 部落格園創立於2004年,是一個面向開發人員的知識分享社區。部落格園自創立之初就一 直致力於解決如何協助開發人員用代碼改變世界。曾被評為“2007年中國最具投資價值100網站”。 部落格園來到了上海,有了自己的團隊,註冊使用者4萬多,每天有15萬以上的使用者訪問,除了部落格, 有了互動交流的小組,有了你問我答的博問,有了收藏精彩內容的網摘,有了搜尋站內內容的找找看, 有了隨時記錄思想火花的快閃記憶體,有了隨時瞭解業內動態新聞頻道,有了知識庫,有了期刊,有了…… 部落格園的使用者中成長出了一批又一批專家,在IT行業中大展身手! 部落格園在行業中的影響力越來越大! 部落格園正朝著高品質的IT媒體與社區方向發展…… </textarea> </div> <script type="text/javascript"> $(".big").click(function(){ if(! $(".cc").is(":animated")){ if($(".cc").height() < 500){ //$(".cc").height($(".cc").height() + 50); $(".cc").animate({height: "+=50"}, 400); } } }) $(".small").click(function(){ if(! $(".cc").is(":animated")){ if($(".cc").height() > 50){ //$(".cc").height($(".cc").height() - 50); $(".cc").animate({height: "-=50"}, 400); } } }) </script> </body></html>
CSS:
.big, .small{ border: 1px double red; background-color: yellow; cursor: pointer;}
END
jQuery——表單應用(2)