Blame view

frontend/web/js/widget-carousel/HOME_SLIDER/style.js 1.51 KB
ecf49b1b   Administrator   second
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  
  $(document).on('ready', function ()
  {
      var HOME_SLIDER_option_2 =
      {
          $AutoPlay: true,
          $AutoPlaySteps: 1,
  //        $AutoPlayInterval: 4000, есть в HOME_SLIDER_option_1
          $PauseOnHover: 1,
  
          $ArrowKeyNavigation: true,
  //        $SlideDuration: 500,     есть в HOME_SLIDER_option_1
          $MinDragOffsetToSlide: 20,
  
          $SlideSpacing: 0,
          $DisplayPieces: 1,
          $ParkingPosition: 0,
          $UISearchMode: 1,
          $PlayOrientation: 1,
          $DragOrientation: 1,
  
          $BulletNavigatorOptions: {
              $Class: $JssorBulletNavigator$,
              $ChanceToShow: 2,
              $AutoCenter: 0,
              $Steps: 1,
              $Lanes: 1,
              $SpacingX: 10,
              $SpacingY: 10,
              $Orientation: 1
          },
  
          $ArrowNavigatorOptions: {
              $Class: $JssorArrowNavigator$,
              $ChanceToShow: 2,
              $AutoCenter: 0
          }
      };
  
      var HOME_SLIDER = new $JssorSlider$("HOME_SLIDER", $.extend({}, HOME_SLIDER_option_1, HOME_SLIDER_option_2));
  
      function ScaleHOME_SLIDER ()
      {
          $item = $("#HOME_SLIDER .item").width();
  
          if ($(window).width())
          {
              $body = $(window).width() - 70;
              HOME_SLIDER.$ScaleWidth(Math.min($body, $item));
          }
          else
          {
              window.setTimeout(ScaleHOME_SLIDER, 30);
          }
      }
  
      ScaleHOME_SLIDER();
  
      $(window).bind("resize", ScaleHOME_SLIDER);
      $(window).bind("orientationchange", ScaleHOME_SLIDER);
  });