使用前先引入jquery

<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" 
type="text/javascript"></script>

然後這是一個簡單的判斷式

<script type="text/javascript">
$(function(){
$("h2").css("cursor","pointer").click(function(){
if($(this).next().css("display")=="none")
$(this).next().fadeIn("fast")
else
$(this).next().fadeOut("normal")
      });
});
</script>
arrow
arrow
    全站熱搜

    bshadow 發表在 痞客邦 留言(3) 人氣()