你能帮我写一个HTML推广广告吗,要有图片轮播,要有动态交互效果,要适应屏幕大小,要有文字介绍,写个示例源码,最好用一些常用的插件
时间: 2023-04-03 09:03:13 浏览: 82
当然可以,以下是一个示例源码,包含图片轮播、动态交互效果、适应屏幕大小和文字介绍。我使用了常用的插件,如jQuery和Bootstrap。
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML推广广告示例</title>
<!-- 引入jQuery和Bootstrap -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css">
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.3/js/bootstrap.min.js"></script>
<style>
.carousel-item {
height: 400px;
background-color: #eee;
display: flex;
align-items: center;
justify-content: center;
}
.carousel-item img {
max-height: 100%;
max-width: 100%;
}
</style>
</head>
<body>
<div class="container">
<h1>HTML推广广告示例</h1>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- 轮播图 -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://picsum.photos/id/1018/1000/400" alt="轮播图1">
</div>
<div class="carousel-item">
<img src="https://picsum.photos/id/1015/1000/400" alt="轮播图2">
</div>
<div class="carousel-item">
<img src="https://picsum.photos/id/1019/1000/400" alt="轮播图3">
</div>
</div>
<!-- 左右箭头 -->
<a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!-- 动态交互效果 -->
<div class="row">
<div class="col-md-6">
<h2>产品介绍</h2>
<p>这是一个非常好用的产品,可以帮助您解决很多问题。</p>
<button class="btn btn-primary" id="buyBtn">立即购买</button>
</div>
<div class="col-md-6">
<h2>用户评价</h2>
<ul id="commentList">
<li>这个产品真的很好用!</li>
<li>我用了这个产品,效果非常棒!</li>
<li>推荐给大家使用!</li>
</ul>
<form id="commentForm">
<div class="form-group">
<label for="commentInput">发表评论</label>
<textarea class="form-control" id="commentInput" rows="3"></textarea>
</div>
<button type="submit" class="btn btn-primary">提交评论</button>
</form>
</div>
</div>
</div>
<script>
// 动态交互效果
$('#buyBtn').click(function() {
alert('您已成功购买该产品!');
});
$('#commentForm').submit(function(event) {
event.preventDefault();
var comment = $('#commentInput').val();
$('#commentList').append('<li>' + comment + '</li>');
$('#commentInput').val('');
});
</script>
</body>
</html>
```
希望这个示例源码能够帮助到您!
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)