PHP函数里面写JQ CSS HTML的写法案例

/**
 * @description: 返回顶部
 * @param {*}
 * @return {*}
 */
public function gotop()
{
    global $_L, $COMCFG;
    $plugin = $COMCFG['plugin']['gotop'] ?: [];
    $plugin = array_merge([
        "right"   => 30,
        "bottom"  => 80,
        "color"   => "rgba(255, 255, 255, 1)",
        "bgcolor" => "rgba(96, 98, 102, 1)",
    ], $plugin);
    if ($plugin['style'] == "1" && $plugin['image']) {
        $css  = '';
        $html = '
. oss($plugin['image']) . '" alt="GOTOP" title="GOTOP"/>
'
; } else { $css = ''; $html = '
'
; } echo "LCMSJQ('body').append('{$css}').append('{$html}');"; echo 'if(LCMSJQ(".lcms-gotop-Box").length>0){LCMSJQ(window).scroll(function(){if(LCMSJQ(this).scrollTop()>100){LCMSJQ(".lcms-gotop-Box").fadeIn()}else{LCMSJQ(".lcms-gotop-Box").fadeOut()}});LCMSJQ(".lcms-gotop-Box").click(function(){LCMSJQ("html ,body").animate({scrollTop:0},300);return false});}'; }

你可能感兴趣的:(php,css,html)