案例:jQuery UI案例     状态:可编辑再运行    进入竖版
 运行结果 
AخA
 
1
<!doctype html>
2
<html lang="en">
3
<head>
4
  <meta charset="utf-8">
5
  <title>jQuery UI 折叠面板(Accordion) - 当悬停时打开</title>
6
  <link rel="stylesheet" href="/css/jqu1.10.4/jquery-ui.min.css">
7
  <script src="/js/jqu/jquery.min1.10.2.js"></script>
8
  <script src="/js/jqu/jquery-ui.min1.10.4.js"></script>
9
  <link rel="stylesheet" href="jqueryui/style.css">
10
  <script>
11
  $(function() {
12
    $( "#accordion" ).accordion({
13
      event: "click hoverintent"
14
    });
15
  });
16
 
17
  /*
18
   * hoverIntent | Copyright 2011 Brian Cherne
19
   * http://cherne.net/brian/resources/jquery.hoverIntent.html
20
   * modified by the jQuery UI team
21
   */
22
  $.event.special.hoverintent = {
23
    setup: function() {
24
      $( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler );
25
    },
26
    teardown: function() {
27
      $( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
28
    },
29
    handler: function( event ) {
30
      var currentX, currentY, timeout,
31
        args = arguments,
32
        target = $( event.target ),
33
        previousX = event.pageX,
34
        previousY = event.pageY;
35
 
36
      function track( event ) {
37
        currentX = event.pageX;
38
        currentY = event.pageY;
39
      };
40
 
41
      function clear() {
42
        target
43
          .unbind( "mousemove", track )
44
          .unbind( "mouseout", clear );
45
        clearTimeout( timeout );
46
      }
47
 
48
      function handler() {