July 6, 2013

.hover 滑鼠指標 指入/指出


 <style>
   .hoverStyle{width: 100px;
                    height: 100px;
                background-color: aqua;
                text-align: center;
                line-height: 100px; 
                }
            
 </style>

 <script src="scripts/jquery-1.10.2.min.js" type="text/javascript"></script>
 <script type="text/javascript">
            $(document).ready(function(){
                $("#hoverTest").hover(inhandel , outhandel); //hover是滑鼠指標動作,後面參數(移入,移出)
                
                  function inhandel(e){
                   
                   $(this).css('background-color', 'red'); //移入變紅色
                }
                
                  function outhandel(e){
                   $(this).css('background-color', 'green'); //移出變綠色
                }
                
            });            
 </script> 



尚未移動到


滑鼠指到


滑鼠移出


 



0推薦此文章
Today's Visitors: 0 Total Visitors: 0
Personal Category: $ JQuery Topic: technology / tech info / programming
Previous in This Category: datepicker 日歷選擇   Next in This Category: 燈箱效果

誰來收藏
Loading ...
unlog_NVPO 0