代码

<template>
<div> <!-- 左侧的滑动模块 -->
<div
class="scroll-box"
:style="{width: 1106*screenWidth/1920+'px', height:336.52*screeHeight/1080+'px',top:130*screeHeight/1080+'px'}"
>
<div class="item" v-for="(item,index) of book" :key="index">
<div
class="boximg1"
:style="{width: 285.51*screenWidth/1920+'px', height:315.52*screeHeight/1080+'px',top:10*screeHeight/1080+'px',marginLeft:50*screenWidth/1920+'px'}"
> <div
class="boximg3"
:style="{width: 166.92*screenWidth/1920+'px', height:223.15*screeHeight/1080+'px',top:12*screeHeight/1080+'px'}"
>
<img
:src="item.bookImg"
:width="166.92*screenWidth/1920+'px'"
:height="223.15*screeHeight/1080+'px'"
>
</div> <div class="text" :style="{top:25*screeHeight/1080+'px'}">{{item.bookName}}</div>
</div>
</div>
</div> </div>
</template> <script>
export default {
data() {
return {
screenWidth: 1000, //宽屏幕尺寸
screeHeight: 1000,
book: [
{
id: 1,
zm: "A",
dc: "A",
dcfy: "ə",
zwfy: "a字母",
zwpy: "a",
dctp: "图片",
dcyp: "音频",
fiex01: null,
fiex02: null
},
{
id: 2,
zm: "A",
dc: "Alligator",
dcfy: "ˈælɪɡeɪtər",
zwfy: "鳄鱼",
zwpy: "è yú",
dctp: null,
dcyp: null,
fiex01: null,
fiex02: null
},
{
id: 3,
zm: "A",
dc: "Ant",
dcfy: "ænt",
zwfy: "蚂蚁",
zwpy: "mǎ yǐ",
dctp: null,
dcyp: null,
fiex01: null,
fiex02: null
},
{
id: 4,
zm: "A",
dc: "Apple",
dcfy: "ˈæpl",
zwfy: "苹果",
zwpy: "píng guǒ",
dctp: null,
dcyp: null,
fiex01: null,
fiex02: null
}
]
};
}, mounted() {
//获取屏幕长宽
(this.screenWidth = document.documentElement.clientWidth),
(this.screeHeight = document.documentElement.clientHeight),
(window.onresize = () => {
//屏幕尺寸变化就重新赋值
return (() => {
this.screenWidth = document.documentElement.clientWidth;
this.screeHeight = document.documentElement.clientHeight;
})();
});
}
};
</script> <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.scroll-box {
/* 给父盒子设置相对定位 */
position: relative;
/* position: relative; */
box-shadow: 0 0 5px 2px #25c985;
text-align: center;
white-space: nowrap;
overflow-y: scroll;
overflow-x: hidden;
/* 让父盒子水平居中
margin: 0 auto; */
}
/* 隐藏滚动条 */
::-webkit-scrollbar {
width: 0 !important;
}
::-webkit-scrollbar {
width: 0 !important;height: 0;
}
/* 横线滑动 */
.item {
white-space: nowrap;
display: inline-block;
}
.boximg1 {
/* 给父盒子设置相对定位 */
position: relative; box-shadow: 0 0 0 1px #0f0b00;
/* background: #f7aa05; */
/* margin:0 20px */
/* 边框圆角 */
border-top-right-radius: 10px;
border-top-left-radius: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
.boximg3 {
/* 给父盒子设置相对定位 */
position: relative;
display: flex;
/* 给父盒子设置相对定位 */
box-shadow: 0 0 0 2px #a09e9ee3;
background: hsl(60, 9%, 98%);
margin: 0 auto;
/* margin:0 20px */
}
.text {
/* 给父盒子设置相对定位 */
position: relative;
color: hsl(60, 9%, 98%);
font-size: 20px; -webkit-text-stroke: 0.2px rgb(15, 15, 15);
}
</style>

效果

最新文章

  1. luogu1151 亲戚
  2. 在ESXi 5.x之间冷迁移虚机
  3. ldataset 与 list 的使用
  4. 猫都能学会的Unity3D Shader入门指南
  5. poj1417 带权并查集+0/1背包
  6. poi生成excel
  7. NET分布式缓存Memcached测试体验
  8. MVC(Model View Controller)框架
  9. Android设置输入框和软键盘动态悬浮
  10. Android L动画入门
  11. HTML基础上
  12. 小白的Python之路_day2
  13. Kotlin 扩展——省略findViewById
  14. 通过Loadruner对mysql数据库进行增删改查
  15. 004之MFCSocket同步编程(指针机制)
  16. @Vue/Cli 3 Invalid Host header 检测关闭
  17. Kali Linux之web安全扫描器skipfish使用
  18. Linux在shell中输入历史命令
  19. DefaultSingletonBeanRegistry
  20. sar命令使用详解

热门文章

  1. 前端之JavaScript(Js)基础
  2. static有什么作用?
  3. lua中self的意义
  4. host头攻击
  5. &lt;二&gt;JMeter/Navicat for MYSQL运行案例
  6. 力扣:面试题58 - II. 左旋转字符串
  7. bzoj 3669
  8. 1903021126 申文骏 Java 第六周作业 类与对象
  9. 20220719 第七组 陈美娜 Java(this,封装,构造器概念)
  10. CF 1272 D. Remove One Element