XChÅ©¦Bê·éGtFNgÌ¢½ñÂÌCSScj [
Two CSS vertical menu with show/hide effects
ãLÌTCgÉÄAcÀÑÉÈÁÄ¢éj [ª
JavaScriptÆMootoolsðgÁÄÐî³êÄ¢½ÌÅ·ªA
TvÌvr [ÌæªØêÄ\¦³êÄ¢½èA
¡ðæƯ¶Éµ½¢ÆvÁ½ÌÅA\[X𵢶ÁÄÝܵ½B
»µÄAlÍMootoolsÆjQueryÌñÂÌû@ÅA
Web2.0Ìcj [Ìshow/hideGtFNgð¯½ÌÅA
ärµÄÝæ¤Æv¢Ü·B
CSS
¢«ÈèÅ·ªAÏXãÌCSSð¢Ä¨«Ü·Bbody{font-family:Arial, Helvetica, sans-serif; font-size:13px;} /* ----------------------------------- */ /* BUTTON */ .button{ color:#FFFFFF; clear:both; display:block; font-size:13px; font-weight:bold; height:25px; width:198px; } a.button { text-decoration:none; } .button span { background:url(https://h2ham.up.seesaa.net/image/button.png) left top no-repeat; display:block; height:31px; line-height:31px; padding-left:10px; } /* ----------------------------------- */ /* MENU */ .v-menu{ border:solid 1px #7F9FBF; width:198px; } ul.v-menu, .v-menu li{ display:block; float:left; clear:left; padding:0; margin:0; list-style:none; } ul.v-menu{ clear:both; padding:6px 10px; width:176px; } .v-menu li a{ color:#555555; font-weight:bold; display:block; border-top:solid 1px #DEDEDE; padding:4px 0; text-decoration:none; } .v-menu li a:hover{ color:#999999; }
±ÌCSSÝè¾ÆANbNµ½ãÌæðÏXµÜ¹ñB
ìÁÄ¢éÅÉYêÄ¢½ÌÅ·ªA²¹³¾³¢B
åÈÏX(C³)_
åÈÏX_ƵÄÍAXChµÄoÄéªÌTCYðÅèµÜµ½B¸êÄ¢ÄàÇ©Á½ÌÅ·ªA¯¶Éµ½©Á½ÌÅ·B
»êÆAwiÉüêçêÄ¢½æ੦éæ¤ÉµÜµ½B
widthðwèµ½ç¢Å·¯ÇËB
(±ÌiKÅNbNãÌæðÁµÄµÜÁ½ÌÅA
wiæÌwèÍÁ³È¢ûª¢¢©àµêܹñB)
»µÄAXChµÄoÄ骪«¿ñÆæ̺Æ
ÁÂæ¤Éµ³ð²ßµÜµ½B
IE¾Æmargin-topªLøÉÈÁĵÜÁÄ¢½ÌÅA margin-topàíµÜµ½B
Xg̳à»ê¼ê¯¶Éµæ¤ÆvÁ½ÌÅA
floatÆclearðwèµpaddingů¶³ÉÈéæ¤ÉµÜµ½B
±ÌñÂðwèµÄ¢È¢ÆAȺ©]ª½ÆçêĵܢA
\¦ªuEUů¶ÉÈçÈ©Á½ÌÅAwèµÜµ½B
±êÅêA¯¶TCYÉÈÁÄ¢éÆv¢Ü·B
±ÌwèÅA¡ÌTCYÍ{^àXChà í¹çêÜ·I
»µÄ{^ÆXChµÄéXgÌ«Eà
ÁÂæ¤ÉÈÁÄ¢éÆv¢Ü·B
ÈÉ©oOª êβñ¨è¢µÜ·B
jQueryÆMootools
lªåÉpµÄ¢éÌÍjQueryÈñÅ·ªA
vr [É Á½Mootools൳íÁÄÝܵ½B
¿åÁƵ©¢¶ÁĢȢÌÅAÈñÆྦȢÌÅ·ªA
¿åÁÆÈêÈ¢Æg¢Ãç¢Ì©àµêܹñB
Å·ªAMootoolsÉÍMootoolsÌ¢¢ªà éæ¤ÈÌÅ
prÉæÁÄg¢ª¯éÆ¢¢Æv¢Ü·B
jQueryÅìÁ½Æ«Ì\[X
MootoolsÌ\[XÍ·ÅÉoÄ¢éÌÅȪµÜ·B<a href="#" class="button" id="toggle"> <span>Click Here</span> </a> <ul id="v-menu2" class="v-menu"> <li><a href="#">Technology</a></li> <li><a href="#">Design</a></li> <li><a href="#">Css Gallery</a></li> <li><a href="#">Entertainment</a></li> <li><a href="#">Programming</a></li> </ul>
CSSÍãÅ¢½Ìðg¢Ü·B
JqvaScriptÌwèÍȺÌÊèB
$(document).ready(function(){ $("#v-menu2").hide(); $("#toggle").click(function(){ $("#v-menu2").slideToggle("slow"); }); });
Àͱê¾ÆæªÏ»µÈ¢ÌÅAêÂw誽èÈ¢ÌÅ·ªA
XChªÍR¾¯ÅnjB
XCh·é¬xàwèÅ«éµA
Mootoolsæèàwèªy©ÈÁÄv¢Ü·B
vr [ͱ¿ç
EjQuery
EMootools
MootoolsÆjQuery̾ç©Èá¢
ãÌvr [ðÝÄCâ½BwèÌᢩçéàÌ©àµêܹñªA
¾ç©É®ìªáÁ½ÌÅÐîµÄ¨«Ü·B
FirefoxÌAhIÌFirebugÅ®«ð©½Æ±ëA
±ñÈᢪoĢܵ½B
jQuery
®ìO
®ìã
Mootools
®ìO®ìã
Å©çá¤ñÂ
HTMLàCSS௶ÈÌÉAXNvgűñÈÉÏíéÆÍBjQueryÍstyleÌwèͦéàÌÌAÁÉÏ»ªÈ¢Ìªí©éB
ƱëªMootoolsÌûÍAÅ©çulªdivÅÍÜêÄ¢éB
»ñÈwèÍêصĢȢÌÉA®ìªÅ©çá¤Ì¾I
±Ìá¢ÉÍÁ¢½B
ÈÌÅA±ÌGg[ÌÅÉ¢½CSSÅÍA
MootoolsÌXChÌÊuªEÉ éB
divªüÁĵÜÁÄ¢é©ç¾ë¤
Mootoolsðg¤ÛÍA±Ìá¢ÉCð¯½Ù¤ªæ³»¤¾B
ÁıÆÅMootoolsÌÙ¤ÌCSSðµÏXµ½B
{^ÌÙ¤ÌfloatÌwèðíµÜµ½B
EMootools
âÁÏèlÍjQueryÌûªg¢â·¢ÈÁÄ´¶½Gg[ŵ½B
F³ñÌTCgÌGtFNgÉAgÁÄÝÄÍǤŵå¤I