PageSourceSearch

https://biblio.bnu.fr/opac/sebinayou/js/sy/3.03.RollBanner.js

js bnu.fr collected 2026-09-24 19:22:18 UTC 1,170 bytes, 68 lines download raw bytes

1var ROLLBANNER = function() {
2
3  var defaults = {
4
5    interval: 10000,
6    mode: 0
7  };
8
9  var p;
10
11  var timer;
12  var current = 0;
13
14  function _init(params) {
15    p = $.extend(true, {}, defaults, params);
16  }
17
18  function _random(seed) {
19    return Math.floor(Math.random()*seed)+1;
20  }
21
22  return {
23
24    start: function(params) {
25      _init(params);
26
27      var node = $(p.selector);
28      if (!node.length || p.frames <= 0) {
29        return;
30      }
31      this.change(false);
32
33      if (p.interval) {
34        p.timer = setInterval(this.change, p.interval);
35      }
36    },
37
38    stop: function() {
39      clearInterval(timer);
40    },
41
42    change: function(fade) {
43      var old = current;
44      if (p.mode > 0) {
45        ++current;
46        if (current > p.frames) {
47          current = 1;
48        }
49      } else {
50        current = _random(p.frames);
51      }
52      var node = $(p.selector);
53
54      function action() {
55        node
56          .removeClass("r_banner" + old)
57          .addClass("r_banner" + current)
58          .fadeTo(500, 1);
59      }
60
61      if (fade === false) {
62        action();
63      } else {
64        node.fadeTo(500, 0, action);
65      }
66    }
67  };
68}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.