广告位招租

漂浮广告自适应手机移动端底部JS代码整理

昨天有一个网友询问是否可以实现在移动端底部迁入广告代码,然后固定在底部的图片样式JS代码。这里直接将可用的方法整理出来,后来他测试后是可以使用的。我这里也记录下来,以后如果有需要的可以直接拿来使用。

第一、CSS样式部分

<style>
.margingT {
margin-bottom: 80px;
}

.bottommob{
-webkit-box-sizing: border-box;
height: 80px;
position: fixed;
bottom: 0;
left: 0;
z-index: 1000;
padding: 0 10px;
overflow: hidden;
width: 100%;
background: rgba(0, 0, 0, .8);
}

.bottom-pic {
position: absolute;
top: 10px;
width: 60px;
height: 60px;
overflow: hidden;
-webkit-border-radius: 10px;
border-radius: 10px;
}

.bottom-pic img {
width: 100%;
height: 100%;
}

.bottom-text {
margin-left: 70px;
line-height: 80px;
font-size: 32px;
color: #fff;
}

.bottom-btn {
position: absolute;
top: 20px;
right: 10px;
height: 40px;
line-height: 40px;
color: #fff;
background-color: #60b900;
border-radius: 6px;
text-align: center;
font-size: 24px;
padding: 0 5px;
font-weight: bold;
}

.bottommob a {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
</style>

第二、DIV代码部分

<div class=”bottommob” id=”bottommob”>
<div class=”bottom-con”>
<div class=”bottom-pic”>
<img src=”图片地址” width=”60″ height=”60″ alt=”” />
</div>
<div class=”bottom-text” id=”bottomText”>说明文字</div>
<div class=”bottom-btn”>点击按钮</div>
</div>
<a id=”bottomLink” href=”指向的链接”></a>
</div>

这里没有用到JS代码,这里直接用的是DIV漂浮样式,这样效果会更好一些,因为有些浏览器是拦截JS的。如果有需要的网友可以使用。

原文链接:https://www.exueyuan.top/284.html,转载请注明出处。

0
广告位招租

评论0

请先

广告位招租
易学手机界面分析工具上线!可用于安卓手机界面,模拟器界面分析,加速自动化开发!查看详情
没有账号? 注册  忘记密码?

社交账号快速登录

微信扫一扫关注
如已关注,请回复“登录”二字获取验证码

Warning: error_log(/www/wwwroot/exueyuan.top/wp-content/plugins/spider-analyser/#log/log-1915.txt): failed to open stream: No such file or directory in /www/wwwroot/exueyuan.top/wp-content/plugins/spider-analyser/spider.class.php on line 2900