提示消息无缝向上滚动(vue)
<div class="order-tips__message-item"
:class="getClass(index)"
v-for="(orderTip, index) in tips"
:key="index">
{{orderTip[]}}
</div>
<script>
export default {
props: ['lbxxzsList', 'orderNum'],
data() {
return {
index: ,
tips: ['提示1', '提示2', '提示3']
};
},
computed: {
maxIndex() {
return this.tips.length - ;
},
},
methods: {
getClass(index) {
if (this.maxIndex === ) {
return {};
}
return {
'order-tips__message-item--slidein': index === this.index,
'order-tips__message-item--slideout': index === (this.index - ) || (this.index === && index === this.maxIndex),
};
},
},
mounted() {
setInterval(() => {
const { index, maxIndex } = this;
this.index = index < maxIndex ? index + : ;
}, );
},
};
</script>
.order-tips__message {
position: relative;
}
.order-tips__message-item {
position: absolute;
top: 17px;
opacity: ;
}
.order-tips__message-item--slidein {
top: ;
opacity: ;
transition: top 1s, opacity 1s;
}
.order-tips__message-item--slideout {
top: -16px;
opacity: ;
transition: top 1s, opacity 1s;
}
提示消息无缝向上滚动(vue)的更多相关文章
- vue文字间歇无缝向上滚动
公司的管理系统中有"文字间歇无缝向上滚动"的需求,现在这种需求基本在项目开发中已经消失了,没什么新颖的,但架不住公司高层喜欢这种玩意儿,所以,作为开发人员,即使你有一百个不乐意,谁 ...
- 基于zepto的插件之移动端无缝向上滚动并上下触摸滑动
该插件乃本博客作者所写,目的在于提升作者的js能力,也给一些js菜鸟在使用插件时提供一些便利,老鸟就悠然地飞过吧. 公司的移动端项目是基于zepto的,有一个页面要求文字能够无缝地不停向上滚动,但查了 ...
- jquery插件之文字无缝向上滚动
该插件乃本博客作者所写,目的在于提升作者的js能力,也给一些js菜鸟在使用插件时提供一些便利,老鸟就悠然地飞过吧. 此插件旨在实现目前较为流行的无缝向上滚动特效,当鼠标移动到文字上时,向上滚动会停止, ...
- 文字列表无缝向上滚动JavaScript代码
<!DOCTYPE html> <html> <head> <meta charset=utf-> <title>文字列表无缝向上滚动Jav ...
- 原生js实现文字无缝向上滚动效果
在网上查找到了一个实现文字无缝向上滚动效果的源码,结果发现运行有问题,于是就稍加改动,实现了js无缝向上滚动的效果. <script> window.onload = roll(50); ...
- js实现文字列表无缝向上滚动
body{font-size:12px} #demo{overflow:hidden; height:80px; width:280px; margin:90px auto; position:rel ...
- jquery无缝向上滚动实现代
<!DOCTYPE html><html><head><style type="text/css">.renav{width:200 ...
- jquery插件之文字间歇自动向上滚动
该插件乃本博客作者所写,目的在于提升作者的js能力,也给一些js菜鸟在使用插件时提供一些便利,老鸟就悠然地飞过吧. 此插件旨在实现目前较为流行的文字间歇向上滚动特效,当鼠标移动到文字上时,向上滚动会停 ...
- Vue 消息无缝滚动
vue实现消息向上无缝滚动效果 <ul class="new-list" :class="{anim:animate}" @mouseenter=&quo ...
随机推荐
- getHibernateTemplate()的find用法大全
一.find(String queryString); 示例:this.getHibernateTemplate().find("from bean.User"); 返回所有Use ...
- dotfuscator安装
1.vs 2017 安装 dotfuscator 组件 打开vs 2017 按 ctrl + Q在输入框中输入“dotfuscator” ,选中第一个. 2.安装完成后即可在vs的工具中看到该组件 3 ...
- A - Divide it! CodeForces - 1176A
题目: You are given an integer nn. You can perform any of the following operations with this number an ...
- 用数组实现队列(C++)
#include <iostream> using namespace std; template<typename T, int size = 0> class Queue ...
- cesium入门示例-HelloWorld
示例准备: 在Cesium ion官网(https://cesium.com/)上注册用户,获取AccessToken,在js代码入口设置Cesium.Ion.defaultAccessToken,即 ...
- 实战:CentOS 7.2 / Zabbix3.4安装graphtrees
众所周知的 Zabbix图形显示问题,决定使用graphtrees 插件. 环境:CentOS7.2 + Zabbix 3.4 1)首先切换到root用户以获得足够的权限将资源下载到 /usr/sha ...
- 传统if 从句子——以条件表达式作为if条件
传统if 从句子——以条件表达式作为 if条件if [ 条件表达式 ]then command command commandelse command commandfi 条件表达式 文件表达式 ...
- 添砖加瓦:[OpenCV]入门(一)
1.OpenCV安装 (1)下载: 本文采用的是源码的方式进行安装,源码可以从OpenCV官网下载.这里以3.4.1为例. (2)安装 这里下载到的文件为3.4.1.zip."unzip 3 ...
- 内核融合:GPU深度学习的“加速神器”
编者按:在深度学习"红透"半边天的同时,当前很多深度学习框架却面临着共同的性能问题:被频繁调用的代数运算符严重影响模型的执行效率. 本文中,微软亚洲研究院研究员薛继龙将为大家介绍 ...
- Shevon's Blog
由于a link是disabled属性设置成true,只是颜色变灰色但是还能提交.要想不能提交,可以删除href属性:disable link[html] view plaincopyfunction ...