css transition height:auto 不生效
height由固定px变化为auto时,transition效果不会生效
解决方案:
将height替换为max-height,并设置一个足够大的max-height
height由固定px变化为auto时,transition效果不会生效
解决方案:
将height替换为max-height,并设置一个足够大的max-height
// 按权重抽奖
function get_rand($proArr)
{
    $result = '';
    // 概率数组的总概率精度
    $proSum = array_sum($proArr);
    // 概率数组循环
    foreach ($proArr as $key => $proCur) {
        $randNum = mt_rand(1, $proSum);  // 返回随机整数
        if ($randNum <= $proCur) {
            $result = $key;
            break;
        } else {
            $proSum -= $proCur;
        }
    }
    unset($proArr);
    return $result;
}
$arr = [
    // 奖项id => 奖项权重
    '1' => 50,
    '2' => 100,
    '3' => 300
];
$randId = get_rand($arr); // 返回,即为随机抽取的奖品ID