Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP-在同一文件上多次运行相同的PHP函数_Php - Fatal编程技术网

PHP-在同一文件上多次运行相同的PHP函数

PHP-在同一文件上多次运行相同的PHP函数,php,Php,我目前正在创建一个数据库/表列表类型的系统,它将显示用户当前的喜欢/不喜欢。用户的好恶由一个函数从一个名为displayRating()的单独文件中提取并管理。我使用require_一次调用它所在的单独文件,在列表的开头,然后开始工作 然后我就去拿我的 foreach(...){ ... displayRating($id); ... } 然而,我得到了一个错误,它似乎告诉我,我不能在同一页内多次调用函数。以下是我的准确(未优化)代码: vote.php <?php function d

我目前正在创建一个数据库/表列表类型的系统,它将显示用户当前的喜欢/不喜欢。用户的好恶由一个函数从一个名为
displayRating()
的单独文件中提取并管理。我使用require_一次调用它所在的单独文件,在列表的开头,然后开始工作

然后我就去拿我的

foreach(...){
...
displayRating($id);
...
}
然而,我得到了一个错误,它似乎告诉我,我不能在同一页内多次调用函数。以下是我的准确(未优化)代码:

vote.php

<?php
function displayRating($id){
    if(isset($id)){
        require_once('medoo.min.php');
        // Start up the D.B. Connection
        $database = new medoo([
        // required
        'database_type' => 'mysql',
        'database_name' => '****',
        'server' => 'localhost',
        'username' => '****',
        'password' => '****',
        'charset' => 'utf8',
        // driver_option for connection, read more from http://www.php.net/manual/en/pdo.setattribute.php
        'option' => [
        PDO::ATTR_CASE => PDO::CASE_NATURAL
        ]]);
        // xf_user_field_value DB. Amount of ratings: 506c617965725f7261746573    Current Score: 706c617965725f726174696e67
        $accountinfo = $database->select('xf_user_field_value', ['field_value'], ["user_id"=>$id]);
        $vScore = $accountinfo[5]['field_value'];
        // Processing Time
        $phrase = '<div class="bc"><div data-hint="%1$s" class="hint--right vote %2$s"></div></div>';
        if($vScore == 0){
            printf($phrase, 'Neutral Score', 'v_equal');
            return;
        } elseif ($vScore > 0){
            // Positive Here
            switch($vScore){
                case 1:
                    printf($phrase, '1 Like', 'v_p1 hint--success');
                    break;
                case 2:
                    printf($phrase, '2 Likes', 'v_p2 hint--success');
                    break;
                case 3:
                    printf($phrase, '3 Likes', 'v_p3 hint--success');
                    break;
                case 4:
                    printf($phrase, '4 Likes', 'v_p4 hint--success');
                    break;
                case 5:
                    printf($phrase, '5 Likes', 'v_p5 hint--success');
                    break;
                case 6:
                    printf($phrase, '6 Likes', 'v_p6 hint--success');
                    break;
                case 7:
                    printf($phrase, '7 Likes', 'v_p7 hint--success');
                    break;
                default:
                    printf($phrase, $vScore . ' Likes', 'v_p7 hint-success');
                    break;
            }
        } elseif ($vScore < 0){
            // Negative Here
            switch($vScore){
                case -1:
                    printf($phrase, '1 Dislike', 'v_m1 hint--error');
                    break;
                default:
                    if($vScore < -7){ $vClass = 7; } else { $vClass = abs($vScore); }
                    printf($phrase, abs($vScore) . ' Dislikes', 'v_m' . $vClass . ' hint--error');
            }
        }
    } else {
        return;
    }
}
?>
<?php
function displayCodesMain($page){ 
    if($page == 1){?>
<table class="friendcodes">
    <tr>
        <th>Username</th>
        <th>Friend Code</th>
        <th>Affinity</th>
        <th>Level</th>
        <th>Rating</th>
    </tr>
<?php
$plisting = file_get_contents('plist.txt');
$plist = explode(' ', $plisting, 4);
require_once('vote.php');
array_pop($plist);
    foreach($plist as $item) {
        $item = explode(':', $item);
        echo '<tr class="fc_premium">';
        $item[3] = substr($item[3], 0, 3) . '-' . substr($item[3], 3, 7);
        $item[1] = str_replace('&', ' ', $item[1]);
        echo '<td>' . $item[1] . '</td><td>' . $item[3] . '</td><td style="text-transform:capitalize;">' . $item[4] . '</td><td>' . $item[5] . '</td><td>  <div class="bc"><div class="vote v_p7"> </div></div> </td>';
        echo '</tr>'; 
    }
$listing = file_get_contents('list.txt');
$list = explode(' ', $listing, 26);
array_pop($list);
    foreach($list as $item) {
        $item = explode(':', $item);
        echo '<tr class="fc_regular">';
        $item[3] = substr($item[3], 0, 3) . '-' . substr($item[3], 3, 7);
        $item[1] = str_replace('&', ' ', $item[1]);
        echo '<td>' . $item[1] . '</td><td>' . $item[3] . '</td><td style="text-transform:capitalize;">' . $item[4] . '</td><td>' . $item[5] . '</td><td>'. displayRating($item[0]) .'</td>';
        echo '</tr>'; 
    }

    echo '</table>';
} else if($page == 2) { 
// Start page #2 management
?>
<table class="friendcodes">
    <tr>
        <th>Username</th>
        <th>Friend Code</th>
        <th>Affinity</th>
        <th>Level</th>
    </tr>
<?php
$listing = file_get_contents('list.txt');
$list = explode(' ', $listing, 51);
$list = array_slice($list, 25, 25);
array_pop($list);
    foreach($list as $item) {
        $item = explode(':', $item);
        echo '<tr class="fc_regular">';
        $item[3] = substr($item[3], 0, 3) . '-' . substr($item[3], 3, 7);
        $item[1] = str_replace('&', ' ', $item[1]);
        echo '<td>' . $item[1] . '</td><td>' . $item[3] . '</td><td style="text-transform:capitalize;">' . $item[4] . '</td><td>' . $item[5] . '</td>';
        echo '</tr>'; 
    }
?>
    </table>
    <?php
}
} // Close the function
?>

displayCodes.php

<?php
function displayRating($id){
    if(isset($id)){
        require_once('medoo.min.php');
        // Start up the D.B. Connection
        $database = new medoo([
        // required
        'database_type' => 'mysql',
        'database_name' => '****',
        'server' => 'localhost',
        'username' => '****',
        'password' => '****',
        'charset' => 'utf8',
        // driver_option for connection, read more from http://www.php.net/manual/en/pdo.setattribute.php
        'option' => [
        PDO::ATTR_CASE => PDO::CASE_NATURAL
        ]]);
        // xf_user_field_value DB. Amount of ratings: 506c617965725f7261746573    Current Score: 706c617965725f726174696e67
        $accountinfo = $database->select('xf_user_field_value', ['field_value'], ["user_id"=>$id]);
        $vScore = $accountinfo[5]['field_value'];
        // Processing Time
        $phrase = '<div class="bc"><div data-hint="%1$s" class="hint--right vote %2$s"></div></div>';
        if($vScore == 0){
            printf($phrase, 'Neutral Score', 'v_equal');
            return;
        } elseif ($vScore > 0){
            // Positive Here
            switch($vScore){
                case 1:
                    printf($phrase, '1 Like', 'v_p1 hint--success');
                    break;
                case 2:
                    printf($phrase, '2 Likes', 'v_p2 hint--success');
                    break;
                case 3:
                    printf($phrase, '3 Likes', 'v_p3 hint--success');
                    break;
                case 4:
                    printf($phrase, '4 Likes', 'v_p4 hint--success');
                    break;
                case 5:
                    printf($phrase, '5 Likes', 'v_p5 hint--success');
                    break;
                case 6:
                    printf($phrase, '6 Likes', 'v_p6 hint--success');
                    break;
                case 7:
                    printf($phrase, '7 Likes', 'v_p7 hint--success');
                    break;
                default:
                    printf($phrase, $vScore . ' Likes', 'v_p7 hint-success');
                    break;
            }
        } elseif ($vScore < 0){
            // Negative Here
            switch($vScore){
                case -1:
                    printf($phrase, '1 Dislike', 'v_m1 hint--error');
                    break;
                default:
                    if($vScore < -7){ $vClass = 7; } else { $vClass = abs($vScore); }
                    printf($phrase, abs($vScore) . ' Dislikes', 'v_m' . $vClass . ' hint--error');
            }
        }
    } else {
        return;
    }
}
?>
<?php
function displayCodesMain($page){ 
    if($page == 1){?>
<table class="friendcodes">
    <tr>
        <th>Username</th>
        <th>Friend Code</th>
        <th>Affinity</th>
        <th>Level</th>
        <th>Rating</th>
    </tr>
<?php
$plisting = file_get_contents('plist.txt');
$plist = explode(' ', $plisting, 4);
require_once('vote.php');
array_pop($plist);
    foreach($plist as $item) {
        $item = explode(':', $item);
        echo '<tr class="fc_premium">';
        $item[3] = substr($item[3], 0, 3) . '-' . substr($item[3], 3, 7);
        $item[1] = str_replace('&', ' ', $item[1]);
        echo '<td>' . $item[1] . '</td><td>' . $item[3] . '</td><td style="text-transform:capitalize;">' . $item[4] . '</td><td>' . $item[5] . '</td><td>  <div class="bc"><div class="vote v_p7"> </div></div> </td>';
        echo '</tr>'; 
    }
$listing = file_get_contents('list.txt');
$list = explode(' ', $listing, 26);
array_pop($list);
    foreach($list as $item) {
        $item = explode(':', $item);
        echo '<tr class="fc_regular">';
        $item[3] = substr($item[3], 0, 3) . '-' . substr($item[3], 3, 7);
        $item[1] = str_replace('&', ' ', $item[1]);
        echo '<td>' . $item[1] . '</td><td>' . $item[3] . '</td><td style="text-transform:capitalize;">' . $item[4] . '</td><td>' . $item[5] . '</td><td>'. displayRating($item[0]) .'</td>';
        echo '</tr>'; 
    }

    echo '</table>';
} else if($page == 2) { 
// Start page #2 management
?>
<table class="friendcodes">
    <tr>
        <th>Username</th>
        <th>Friend Code</th>
        <th>Affinity</th>
        <th>Level</th>
    </tr>
<?php
$listing = file_get_contents('list.txt');
$list = explode(' ', $listing, 51);
$list = array_slice($list, 25, 25);
array_pop($list);
    foreach($list as $item) {
        $item = explode(':', $item);
        echo '<tr class="fc_regular">';
        $item[3] = substr($item[3], 0, 3) . '-' . substr($item[3], 3, 7);
        $item[1] = str_replace('&', ' ', $item[1]);
        echo '<td>' . $item[1] . '</td><td>' . $item[3] . '</td><td style="text-transform:capitalize;">' . $item[4] . '</td><td>' . $item[5] . '</td>';
        echo '</tr>'; 
    }
?>
    </table>
    <?php
}
} // Close the function
?>

用户名
好友代码
密切关系
水平仪
评级
用户名
好友代码
密切关系
水平仪
Test.php(我用来动态获取值和whatnot-warning的内容包含一些CSS,您可以安全地跳过它们

<?php
/*include('newUser.php');
addNewUser('1', 'true', 'Spitfire', '8JX-UKR8', 'Spirit', '90');*/
require('displayCodes.php');
displayCodesMain(1);
?>
<head>


<style>
/*! Hint.css - v1.3.2 - 2014-05-18
* http://kushagragour.in/lab/hint/
* Copyright (c) 2014 Kushagra Gour; Licensed MIT */

.hint,[data-hint]{position:relative;display:inline-block}.hint:before,.hint:after,[data-hint]:before,[data-hint]:after{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;-webkit-transition:.3s ease;-moz-transition:.3s ease;transition:.3s ease;-webkit-transition-delay:0ms;-moz-transition-delay:0ms;transition-delay:0ms}.hint:hover:before,.hint:hover:after,.hint:focus:before,.hint:focus:after,[data-hint]:hover:before,[data-hint]:hover:after,[data-hint]:focus:before,[data-hint]:focus:after{visibility:visible;opacity:1}.hint:hover:before,.hint:hover:after,[data-hint]:hover:before,[data-hint]:hover:after{-webkit-transition-delay:100ms;-moz-transition-delay:100ms;transition-delay:100ms}.hint:before,[data-hint]:before{content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1000001}.hint:after,[data-hint]:after{content:attr(data-hint);background:#383838;color:#fff;text-shadow:0 -1px 0 #000;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;box-shadow:4px 4px 8px rgba(0,0,0,.3)}.hint--top:before{border-top-color:#383838}.hint--bottom:before{border-bottom-color:#383838}.hint--left:before{border-left-color:#383838}.hint--right:before{border-right-color:#383838}.hint--top:before{margin-bottom:-12px}.hint--top:after{margin-left:-18px}.hint--top:before,.hint--top:after{bottom:100%;left:50%}.hint--top:hover:after,.hint--top:hover:before,.hint--top:focus:after,.hint--top:focus:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--bottom:before{margin-top:-12px}.hint--bottom:after{margin-left:-18px}.hint--bottom:before,.hint--bottom:after{top:100%;left:50%}.hint--bottom:hover:after,.hint--bottom:hover:before,.hint--bottom:focus:after,.hint--bottom:focus:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--right:before{margin-left:-12px;margin-bottom:-6px}.hint--right:after{margin-bottom:-14px}.hint--right:before,.hint--right:after{left:100%;bottom:50%}.hint--right:hover:after,.hint--right:hover:before,.hint--right:focus:after,.hint--right:focus:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--left:before{margin-right:-12px;margin-bottom:-6px}.hint--left:after{margin-bottom:-14px}.hint--left:before,.hint--left:after{right:100%;bottom:50%}.hint--left:hover:after,.hint--left:hover:before,.hint--left:focus:after,.hint--left:focus:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--error:after{background-color:#b34e4d;text-shadow:0 -1px 0 #592726}.hint--error.hint--top:before{border-top-color:#b34e4d}.hint--error.hint--bottom:before{border-bottom-color:#b34e4d}.hint--error.hint--left:before{border-left-color:#b34e4d}.hint--error.hint--right:before{border-right-color:#b34e4d}.hint--warning:after{background-color:#c09854;text-shadow:0 -1px 0 #6c5328}.hint--warning.hint--top:before{border-top-color:#c09854}.hint--warning.hint--bottom:before{border-bottom-color:#c09854}.hint--warning.hint--left:before{border-left-color:#c09854}.hint--warning.hint--right:before{border-right-color:#c09854}.hint--info:after{background-color:#3986ac;text-shadow:0 -1px 0 #193b4d}.hint--info.hint--top:before{border-top-color:#3986ac}.hint--info.hint--bottom:before{border-bottom-color:#3986ac}.hint--info.hint--left:before{border-left-color:#3986ac}.hint--info.hint--right:before{border-right-color:#3986ac}.hint--success:after{background-color:#458746;text-shadow:0 -1px 0 #1a321a}.hint--success.hint--top:before{border-top-color:#458746}.hint--success.hint--bottom:before{border-bottom-color:#458746}.hint--success.hint--left:before{border-left-color:#458746}.hint--success.hint--right:before{border-right-color:#458746}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:after,.hint--always.hint--top:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--bottom:after,.hint--always.hint--bottom:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--left:after,.hint--always.hint--left:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--always.hint--right:after,.hint--always.hint--right:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--rounded:after{border-radius:4px}.hint--no-animate:before,.hint--no-animate:after{-webkit-transition-duration:0ms;-moz-transition-duration:0ms;transition-duration:0ms}.hint--bounce:before,.hint--bounce:after{-webkit-transition:opacity .3s ease,visibility .3s ease,-webkit-transform .3s cubic-bezier(0.71,1.7,.77,1.24);-moz-transition:opacity .3s ease,visibility .3s ease,-moz-transform .3s cubic-bezier(0.71,1.7,.77,1.24);transition:opacity .3s ease,visibility .3s ease,transform .3s cubic-bezier(0.71,1.7,.77,1.24)}
.vote { background: url('vote.png') no-repeat top left; width: 20px; height: 20px;  } 
.vote.v_m7 { background-position: 0px 0px;  } 
.vote.v_p7 { background-position: 0px -30px;  } 
.vote.v_p6 { background-position: 0px -60px;  } 
.vote.v_m6 { background-position: 0px -90px;  } 
.vote.v_m5 { background-position: 0px -120px;  } 
.vote.v_p5 { background-position: 0px -150px;  } 
.vote.v_p4 { background-position: 0px -180px;  } 
.vote.v_m4 { background-position: 0px -210px;  } 
.vote.v_m3 { background-position: 0px -240px;  } 
.vote.v_p3 { background-position: 0px -270px;  } 
.vote.v_p2 { background-position: 0px -300px;  } 
.vote.v_m2 { background-position: 0px -330px;  } 
.vote.v_m1 { background-position: 0px -360px;  } 
.vote.v_p1 { background-position: 0px -390px;  } 
.vote.v_equal { background-position: 0px -420px;  }
.bc {
    display: inline-block;
    width: 20px;
    height: 20px;
    padding: 1px;
    border-radius: 12px;
    border: 1px solid #888;
}
    .friendcodes {
        border-spacing: 0;
    }
    .friendcodes tr > td {
        padding: 5px 25px;
    }
    .fc_premium {
        background: #ffdf8e;
        border-spacing: 0;
    }
    .fc_regular {
        border-spacing: 0;
    }
</style>
</head>
<body>
    <h3>
    Use form below for Adding IDs
</h3>
<form action="http://shortcutcentral.org/projects/friendcodes/receiveQuery.php" method="post">
    <input type='text' value="481" name="id" /><br>
    <input type="submit" />
</form>
    <h3>
        Current Testing Stuff
    </h3>
    <p>
<?php 
require('vote.php');
displayRating(481);
?>
    </p>
</body>

/*!Hint.css-v1.3.2-2014-05-18
* http://kushagragour.in/lab/hint/
*版权(c)2014 Kushagra Gour;麻省理工学院许可*/
.hint,[data-hint]{position:relative;display:inline block}.hint:before,.hint:after,[data-hint]:before,[data-hint]:before,{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0);可见性:隐藏;不透明度:0;z索引:1000000;指针事件:无;-webkit转换:.3s易用;-moz转换:.3s易用;转换:.3s易用;-webkit转换延迟:0ms;-moz转换延迟:0ms;转换延迟:0ms}。提示:悬停:在之前。提示:悬停:之后。提示:焦点:之前。提示:焦点:之后,[数据提示]:悬停:之前,[数据提示]:悬停:之后,[数据提示]:focus:before,[data-hint]:focus:after{visibility:visible;opacity:1}。提示:hover:before,.hint:hover:after,[data-hint]:hover:before,[data-hint]:data-hint]:hover:after{webkit转换延迟:100ms;-moz转换延迟:100ms;转换延迟:100ms}。提示:before,[data-hint]:before{content:'';position:absolute;background:transparent;border:6px solid transparent;z-index:1000001}。提示:之后,[数据提示]:之后{content:attr(数据提示);背景:#383838;颜色:#fff;文本阴影:0-1px 0#000;填充:8px 10px;字体大小:12px;行高:12px;空白:nowrap;方框阴影:4px 4px 8px rgba(0,0,0,3)}。提示--顶部:之前{边框顶部颜色:#38383838}。提示--底部:在{边框底部颜色:#383838}之前。提示--左侧:在{边框左侧颜色:#38383838}之前。提示--右侧:在{边框右侧颜色:353838}之前。提示--顶部:在{页边距底部:-12px}之前。提示--顶部:在{页边距左侧:-18px}之后。提示--顶部:在{底部:100%;左侧:50%}.hint--top:hover:after、.hint--top:hover:before、.hint--top:focus:after、.hint--top:focus:before{webkit transform:translateY(-8px);-moz transform:translateY(-8px);-transform:translateY(-8px)}.hint--bottom bottom:before{margin top:-12px}.hint--bottom before:before{margin left-left:-18px}.hint--bottom bottom.hint--bottom:hover:after、.hint--bottom:hover:before、.hint--bottom:focus:after、.hint--bottom:focus:before{webkit transform:translateY(8px);-moz transform:translateY(8px);-transform:translateY(8px)}.hint--right:before{margin left:-12px;margin bottom:-6px}.hint--{left:100%;bottom:50%}提示--右:悬停:之后,.hint--右:悬停:之前,.hint--右:焦点:之后,.hint--右:焦点:之前{webkit transform:translateX(8px);-moz transform:translateX(8px);transform:translateX(8px)}。提示--左:之前{页边距右:-12px;页边距底部:-6px}。提示--左:之后{页边距底部:-14px}。提示--左:之前{右:100%;下:50%}提示--左:悬停:之后,.提示--左:悬停:之前,.提示--左:焦点:之后,.提示--左:焦点:之前{webkit transform:translateX(-8px);-moz transform:translateX(-8px);transform:translateX(-8px)}。提示--错误:在{背景色:#b34e4d;文本阴影:0-1px0#592726}提示--错误.提示--顶部:在{边框顶色:35e4d}之前.hint--error.hint--bottom:before{border bottom color:#b34e4d}.hint--left:before{border left color:#b34e4d}.hint--error.hint--bottom right:before{border right color:#b34e4e4d}.hint--left:before{border left-left color:#b34e4e4e4d}.hint--error.hint--right:before{border right color:#b34; b34; b3e4e4d}.hint--b4e4d}.hint--hint--{边框底部颜色:#c09854}。提示--警告。提示--左:在{边框左侧颜色:#c09854}之前。提示--警告。提示--右:在{边框右侧颜色:#c09854}之前。提示--信息:{背景颜色:#3986ac;文本阴影:0-1px 0#193b4d}。提示--信息。提示--顶部:在{边框顶部颜色:#3986ac}之前。提示--信息。提示--底部:在{边框底部颜色:{3986ac}之前.hint--info.hint--left:before{border left color:#3986ac}.hint--info.hint--right:before{border right color:#3986ac}.hint--success:before{background color:#458746;text shadow:0-1px 0#1a321a}.hint--success.hint--top:before{border top顶部颜色:#458746}.hint--success.hint--底部:before{border底部颜色:#458746}.hint--success--{border left color:#458746}.hint--success.hint--right:before{border right color:#458746}.hint--before:after.hint--always:before{border left color:#458746}.hint--right:before{border left right:after.hint--always:before{opacity:1;visibility:visible}.hint--always--tour.hint--top:before.hint--top:before.hint--always.hint--bottom:after.hint--always.hint--bottom:before{webkit transform:translateY(8px);-moz transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--left:after.hint--always.hint--always.hint--always.hint--always.hint--left:before.hint--always.hint--always.hint--.hint--always.hint--right:after,.hint--always.hint--right:before{webkit transform:translateX(8px);-moz transform:translateX(8px);transform:translateX(8px)}.hint--rounded:before{border radius:4px}.hint--no animate:before,.hint--no animate:before{webkit转换持续时间:0ms;-moz转换持续时间:0ms;transition durati