18910140161

JavaScript--如何加载几个div元素?-堆栈溢出

顺晟科技

2022-10-19 12:13:26

15

假设我的网站上有一个加载按钮,如果用户按下按钮,它总是加载新的项目。应该加载的字段如下所示:

我如何添加一个div以上,应该加载在按钮上的klick。我得到了一个应该加载的简单div。但是如何将整个代码块(发送的div)添加到加载按钮中呢?

.main-box {
    background-color: #ffffff;
    height: 130px;
    display: flex;
    width: 798px;
    border-right: solid;
    border-left: solid;
    border-bottom: solid;
    border-color: #E6E6E6;
}

.text-in-main-box{
    font-weight: bold;
    font-family: rob;
    width: 60%;
    padding: 7%;
    display: flex;
    vertical-align: middle;
}

.container-for-button-in-main-box{
    width: 40%;
    display: flex;
    vertical-align: middle;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.button-in-main-box{
    display:inline-block;
    padding:0.8em 1.2em;
    margin:0 0.3em 0.3em 0;
    box-sizing: border-box;
    text-decoration:none;
    font-family:rob;
    font-weight:bold;
    color:#ffffff;
    background-color:#34E034;
    text-align:center;
    transition: all 0.2s;
    font-size: 14px;
    border-radius: 4em;
}

顺晟科技:

而不是使用,我用它做了一个简单的解决方案,它只是向content元素添加字符串。最后,我更改内容的类名来隐藏它。

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航