HEX
Server: Apache
System: Linux web2213.uni5.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64
User: clinicamaciel (596848)
PHP: 7.3.33
Disabled: apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,eval,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv
Upload Files
File: /home/clinicamaciel/www/wp-content/plugins/vc-extensions-bundle/skewbox/js/init.js
jQuery(document).ready(function($) {
  $(".cq-skewbox").each(function(index) {
      var _currentItem = 1;
      var _this = $(this);
      var _itemNumbs = $(".cq-skewbox-item", _this).length;
      var _elementArr = []
      var _autoslide = parseInt($(this).data('autoslide'), 10);
      var _elementheight = parseInt($(this).data('elementheight'), 10);
      var _titlesize = $(this).data('titlesize');
      var _labelsize = $(this).data('labelsize');
      var _timerID = 0;
      var _isDown = true;

      $('.cq-skewbox-item').each(function(index) {
          $('.cq-skewbox-content', $(this)).each(function(index) {
            var _bgcolor = $(this).data('bgcolor');
            if(_bgcolor!="") $(this).css('background', _bgcolor);
          });

      });
      if(_elementheight>0){
        _this.css('height', _elementheight);
      }
      if(_titlesize!=""){
        $('.cq-skewbox-title', _this).css('font-size', _titlesize);
      }
      if(_labelsize!=""){
        $('.cq-skewbox-label', _this).css('font-size', _labelsize);
      }
      $('.cq-skewbox-item', _this).each(function(n) {
          _elementArr[n] = $(this)
      });
      function navigateUp() {
        if (_currentItem === 1) return;
        _currentItem--;
        pagination(_currentItem, _this, _itemNumbs);
      };

      function navigateDown() {
        if (_currentItem === _itemNumbs){
          return false;
          // _currentItem = 0;
        }else{

        }
        _currentItem++;
        pagination(_currentItem, _this, _itemNumbs);
      };
      $('.cq-skewbox-downnav', _this).on('click', function(event) {
        navigateDown();
        event.preventDefault();
      });
      $('.cq-skewbox-upnav', _this).on('click', function(event) {
        navigateUp();
        event.preventDefault();
      });

      function _slideshow(){
        clearTimeout(_timerID);
        if(_autoslide>0){
            _timerID = setTimeout(function() {
                if(_currentItem>=_itemNumbs){
                  _isDown = false;
                }
                if(_currentItem<=1){
                  _isDown = true;
                }
                if(_isDown){
                  navigateDown();
                }else{
                  navigateUp();
                }
                _slideshow();
            }, _autoslide*1000);
        }
      }
      _slideshow();
      _this.on('mouseover', function(event) {
        clearTimeout(_timerID);
      }).on('mouseleave', function(event) {
        if(_autoslide>0) _slideshow();
      });

  });

  function pagination(n, _container, _itemNumbs) {
    var _prevItem, _currentItem, _nextItem = null;
    _prevItem = $('.cq-skewbox-item-' + (n - 1), _container);
    _currentItem = $('.cq-skewbox-item-' + n, _container);
    _nextItem = $('.cq-skewbox-item-' + (n + 1), _container);
    _currentItem.removeClass("inactive").addClass("active");
    _prevItem.addClass("inactive");
    _nextItem.removeClass("active");
  };


});