如何使内容在div底部

如何使内容在div底部

    • 如何插入一段漂亮的代码片

如何插入一段漂亮的代码片

主要的就是这个段代码introduce.scrollTop = introduce.scrollHeight.

function switchs(lable){
        var lable1 = document.getElementById('lable1');
        var lable2 = document.getElementById('lable2');
        var qrCode = document.getElementById('qrCode');
        var introduce = document.getElementById('introduce')
        let qrCodeShow =''
        let detailsShow = ''
        if(lable=='lable1'){
            lable1.className='lable1'
            lable2.className='lable2'

            //底部样式更改
            qrCodeShow = ""
            qrCodeShow +="
" qrCodeShow +="

观看更多直播

"
qrCodeShow +="

请长按右侧二维码

"
qrCodeShow +="

识别并关注公众号

"
qrCodeShow +="
"
qrCode.innerHTML = qrCodeShow detailsShow = "

讲题:"+details.title+"

"
detailsShow += "

时间:"+details.time+"

"
detailsShow += "

讲者:"+details.doctor+"

"
detailsShow += "

医院:"+details.hosp+"

"
detailsShow += "

介绍:"+details.presentation+"

"
introduce.innerHTML =detailsShow }else{ lable2.className='lable1' lable1.className='lable2' // for(let i of comment){ detailsShow +="
" detailsShow +=" " detailsShow +="
" detailsShow +="

"+ i.name+"

"
detailsShow +="

"+ i.text+"

"
detailsShow +="
"
} introduce.innerHTML = detailsShow introduce.scrollTop = introduce.scrollHeight //底部样式更改 qrCodeShow ="
" qrCodeShow +="" qrCodeShow +="
发 表
"
qrCodeShow +="
"
qrCode.innerHTML = qrCodeShow } }

你可能感兴趣的:(工作日记)