R
R
Radiss2019-01-09 23:45:03
PHP
Radiss, 2019-01-09 23:45:03

Why doesn't the animation of the wow plugin work correctly when split-testing?

Good day)
When split-testing sessions "wow", "not_wow" are written to the database, but the animation does not work correctly.
AtArray ( [split] => wow, not_wow )

<div class="wow rollOut">
    Определенная информация
</div>
- animation with not_wow still works exactly.
When Array ( [split] => not_wow )and in these blocks, animation is also performed:
<div class="wrapp-help">
            
<!--1. подкл. 2 файла wow.min.js animate.css, 2 добавляем class wow и 2 парам. опр. дейст. 3 init в functions.js п.6: var wow = new WOW();
  wow.init();  -->
            <div class="help-content wow bounceInLeft" data-wow-duration="0.5s" data-wow-delay="0">
              <div class="h-image">
                <img src="/catalog/view/theme/default/image/icon1.png" alt="alt">
              </div>
              <div class="h-text">
                <h3>Текст</h3>
                <p>Текст</p>
              </div>
            </div>

In index.php at the top I write:
<?php
  require_once "lib/start.php";
  unset ($_SESSION["camp_id"]);
  unset ($_SESSION["split"]);
  
  if (!isset($_SESSION["split"]) || !$_SESSION["split"]) 
  {
    //знач. в values может быть несколько
  $values = array("wow", "no_wow");
  //случ.число
      $rand = mt_rand(0, count($values) - 1);
      /*записываем в сессию случ.знач.кот.выпало от 0 до 1*/
    $_SESSION["split"] = $values[$rand];
     
  }

Down below:
<script src="/catalog/view/javascript/wow.js"></script>
  <script type="text/javascript">
    var wow = new WOW();
    /*если сессия split = wow то init скрипт, если другое знач, то не init*/
    <?php if ($_SESSION["split"] == "wow") { ?>wow.init();<?php } ?>
  </script>

functions.js
$(document).ready(function() {
  /*при сплит тестах выкл. и анализ. внизу в index.php*/
  /*var wow = new WOW();
  wow.init(); */

Screenshot in browser: https://upload.akusherstvo.ru/images/1624808.jpg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question