浏览代码

Listing 7.6: cookie's cyclePaused control.

Frederic G. MARAND 9 年之前
父节点
当前提交
ee39ec5604
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Chapter 7/07.js

+ 3 - 0
Chapter 7/07.js

@@ -4,6 +4,9 @@ $(document).ready(function () {
     speed: 200,
     pause: true
   });
+  if ($.cookie('cyclePaused')) {
+    $books.cycle('pause');
+  }
   var $controls = $('<div id="books-controls"></div>').insertAfter($books);
   $('<button>Pause</button>').click(function (event) {
     event.preventDefault();