When split-testing the animation session "wow", "not_wow" are recorded in the database. But effects work with the no_wow parameter.
No errors are output, although connected to start.php
mb_internal_encoding("UTF-8"); error_reporting(E_ALL); ini_set("display_errors", 1); session_start(); Also in index.php
error_reporting(E_ALL); Session variables output so
print_r ($_SESSION); Array ( [split] => no_wow ) / or wow /
Via var_dump
var_dump($_SESSION); array (1) {["split"] => string (6) "no_wow"} / or wow /
Block code
<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> I register in index.php at the top:
<?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(); */ элемент { visibility: visible; animation-name: flash; }
and in stylesheet.css
.wow { visibility: hidden; /*перечёркнуто*/ }
those. should no_wow visibility be hidden?
index.php Complete code