其他分享
首页 > 其他分享> > 动态创建浮动元素

动态创建浮动元素

作者:互联网

#smoothmenu1{
        width:200px;
        height:200px;
        background-color: #ff9900;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #frameDiv{
        width: 210px;
        height: 40px;
        position: fixed;
        top: 15px;
        right: 20px;
        z-index: 9999;
        color:#cc0000;
        font-size: 20px;
        text-align: right;
        font-weight: bold;
    }
<div id='smoothmenu1'></div>
function fun(){
    setTimeout(function(){
         var frameDiv = document.createElement("div");
         frameDiv.id = 'frameDiv';
         var ssmm1 = $("#smoothmenu1");
         //frameDiv.innerHTML = "";
         ssmm1.append(frameDiv);
         $("#frameDiv").html('123')
    },500)

}
fun()

 

标签:浮动,right,smoothmenu1,frameDiv,元素,动态创建,height,width,font
来源: https://www.cnblogs.com/liufeiran/p/15513481.html