legend2---开发日志11(如何提高终极开发效率)
legend2---开发日志11(如何提高终极开发效率)
一、总结
一句话总结:
实在没必要摸索着做,直接学了做,用专门的东西来做,岂不是要省时省事很多。岂不美哉。
1、vue中的滚动字幕动画效果如何实现(那六个状态怎么确定,active激活态又是什么)?
进入时:在enter中设置初始状态,在enter-to中设置最终状态,在enter-active设置初始状态到最终状态的动画
退出时:在leave中设置初始状态,在leave-to中设置最终状态,在leave-active设置初始状态到最终状态的动画
可以通过vue变量的true和false来触发enter和leave动画
transform: translateX(100%)可做水平移动,表示右移100%
如下代码是滚动字幕的代码
<style>
/* 可以设置不同的进入和离开动画 */
/* 设置持续时间和动画函数 */
.slide-fade-enter-active {
transition: all 7.0s linear;
}
.slide-fade-enter {
transform: translateX(100%);
}
.slide-fade-enter-to ,.slide-fade-leave{
transform: translateX(-100%);
}
</style>
2、css动画中的easy,linear这些是什么属性(就是他们上级的名字)?
transition-timing-function 属性
transition-timing-function: linear|ease|ease-in|ease-out|ease-in-out|cubic-
bezier(n,n,n,n);
| 值 | 描述 |
|---|---|
| linear | 规定以相同速度开始至结束的过渡效果(等于 cubic-bezier(0,0,1,1))。 |
| ease | 规定慢速开始,然后变快,然后慢速结束的过渡效果(cubic-bezier(0.25,0.1,0.25,1))。 |
| ease-in | 规定以慢速开始的过渡效果(等于 cubic-bezier(0.42,0,1,1))。 |
| ease-out | 规定以慢速结束的过渡效果(等于 cubic-bezier(0,0,0.58,1))。 |
| ease-in-out | 规定以慢速开始和结束的过渡效果(等于 cubic-bezier(0.42,0,0.58,1))。 |
| cubic-bezier(n,n,n,n) | 在 cubic-bezier 函数中定义自己的值。可能的值是 0 至 1 之间的数值。 |
3、legend2系统的设计理念是什么?
以加强【好玩性】为主
4、js判断数据是否为空?
if(a === undefined) { // 只能用 === 运算来测试某个值是否是未定义的
if(a == null) { // 等同于 a === undefined || a === null
if(a == "" || a == null || a == undefined){ // "",null,undefined
if(!a){ // "",null,undefined,NaN
if(!$.trim(a)){ // "",null,undefined
if(a.length == 0){ // "",[]
// var a = "";
// var a = " ";
// var a = null;
// var a = undefined;
// var a = [];
// var a = {};
// var a = NaN; if(a === undefined) { // 只能用 === 运算来测试某个值是否是未定义的
console.log("为undefined");
} if(a == null) { // 等同于 a === undefined || a === null
console.log("为null");
} // String
if(a == "" || a == null || a == undefined){ // "",null,undefined
console.log("为空");
}
if(!a){ // "",null,undefined,NaN
console.log("为空");
}
if(!$.trim(a)){ // "",null,undefined
console.log("为空");
} // Array
if(a.length == 0){ // "",[]
console.log("为空");
}
if(!a.length){ // "",[]
console.log("为空");
} // Object {}
if($.isEmptyObject(a)){ // 普通对象使用 for...in 判断,有 key 即为 false
console.log("为空");
}
5、js中如何区别是json对象还是数组?
bottom_broadcast.broadcast instanceof Array 数组返回true,json对象返回false
6、thinkphp中if标签或者关系的多个条件用什么关键词,用'||'可以么?
不可以
要用OR,条件通括号括起来,{if condition="($name == 1) OR ($name > 100) "}
{if condition="($name == 1) OR ($name > 100) "} value1
{elseif condition="$name eq 2"/}value2
{else /} value3
{/if}
7、vue控制的html里面,jquery函数例如$('#commonly_day_day_blog').change(function ()函数不起作用怎么办?
把jquery函数移出vue的控制区域即可
8、当广播部分挡住做题按钮部分,做题按钮无法点击怎么解决?
想办法把广播移到不会和按钮重叠的地方--这种方法不好
用另外一个vue变量来控制文字部分的显示隐藏就好了,不能用和滚动同样的变量,会导致无法滚动

<div v-if="marquee_show_begin" class="broadcast" style="width:100%;height: 35px;line-height:35px;position: fixed;top: 60px;padding: 0 3px;">
<!--用js函数来实现好的多-->
<div style="position:absolute;left: 17px;width: 100%;height: 35px;line-height:35px;">
<transition name="slide-fade">
<p v-if="marquee_show"><span v-html="broadcast.sn_content"></span></p>
</transition>
</div>
</div>
$(function () {
//控制【弹出奖励的】的vue代码
bottom_broadcast = new Vue({
el: '#bottom_broadcast',
data: {
broadcast: window.broadcast,
marquee_show: false,
marquee_show_begin:false,
}
});
if(bottom_broadcast.broadcast instanceof Array) bottom_broadcast.marquee_show=false;
else bottom_broadcast.marquee_show=true;
console.log(bottom_broadcast.broadcast);
});
9、如何让vue实现的广播7s运行一条广播,15s向服务器请求一次,并且广播内容不会在运动完后还静止显示在哪8s?
vue的动画的钩子函数,比如进去前做什么,进入后做什么
在自己的代码中试不出来效果,可以找标准代码来试,比如菜鸟学院上
在菜鸟学院的vue钩子的代码中,vue的css和js效果共存的时候,里面加了一句v-bind:css="false",
<transition name="slide-fade" v-on:before-enter="beforeEnter" v-bind:css="false">
<transition
v-on:before-enter="beforeEnter"
v-on:enter="enter"
v-on:after-enter="afterEnter"
v-on:enter-cancelled="enterCancelled" v-on:before-leave="beforeLeave"
v-on:leave="leave"
v-on:after-leave="afterLeave"
v-on:leave-cancelled="leaveCancelled"
>
<!-- ... -->
</transition>
<!--
Velocity 和 jQuery.animate 的工作方式类似,也是用来实现 JavaScript 动画的一个很棒的选择
-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.2.3/velocity.min.js"></script>
<div id="example-4">
<button @click="show = !show">
Toggle
</button>
<transition
v-on:before-enter="beforeEnter"
v-on:enter="enter"
v-on:leave="leave"
v-bind:css="false"
>
<p v-if="show">
Demo
</p>
</transition>
</div>
new Vue({
el: '#example-4',
data: {
show: false
},
methods: {
beforeEnter: function (el) {
el.style.opacity = 0
el.style.transformOrigin = 'left'
},
enter: function (el, done) {
Velocity(el, { opacity: 1, fontSize: '1.4em' }, { duration: 300 })
Velocity(el, { fontSize: '1em' }, { complete: done })
},
leave: function (el, done) {
Velocity(el, { translateX: '15px', rotateZ: '50deg' }, { duration: 600 })
Velocity(el, { rotateZ: '100deg' }, { loop: 2 })
Velocity(el, {
rotateZ: '45deg',
translateY: '30px',
translateX: '30px',
opacity: 0
}, { complete: done })
}
}
})
10、在广播中,下面的代码里面为什么marquee_show要设置为false,marquee_show_begin要设置为true才有一直的广播的滚动效果?
marquee_show_begin设置为true为广播滚动提供了条件
marquee_show设置为false,是因为请求到数据,marquee_show会为true,而false到true才会触发滚动效果的动画
|||-begin
//每次一条,7秒请求一次,运行7秒
setInterval(function () {
bottom_broadcast.broadcast=[];
bottom_broadcast.marquee_show=false;
bottom_broadcast.marquee_show_begin=true;
require_broadcast();
},7000);
|||-end
二、内容在总结中
legend2---开发日志11(如何提高终极开发效率)的更多相关文章
- MS CRM 2011的自定义和开发(11)——插件(plugin)开发(三)
http://www.cnblogs.com/StoneGarden/archive/2012/02/06/2340661.html MS CRM 2011的自定义和开发(11)——插件(plugin ...
- MS CRM 2011的自定义和开发(11)——插件(plugin)开发(四)
http://www.cnblogs.com/StoneGarden/archive/2012/02/08/2343294.html MS CRM 2011的自定义和开发(11)——插件(plugin ...
- MS CRM 2011的自定义和开发(11)——插件(plugin)开发(一)
http://www.cnblogs.com/StoneGarden/archive/2012/02/02/2336147.html MS CRM 2011的自定义和开发(11)——插件(plugin ...
- MS CRM 2011的自定义和开发(11)——插件(plugin)开发(二)
http://www.cnblogs.com/StoneGarden/archive/2012/02/06/2339490.html MS CRM 2011的自定义和开发(11)——插件(plugin ...
- C#实现多级子目录Zip压缩解压实例 NET4.6下的UTC时间转换 [译]ASP.NET Core Web API 中使用Oracle数据库和Dapper看这篇就够了 asp.Net Core免费开源分布式异常日志收集框架Exceptionless安装配置以及简单使用图文教程 asp.net core异步进行新增操作并且需要判断某些字段是否重复的三种解决方案 .NET Core开发日志
C#实现多级子目录Zip压缩解压实例 参考 https://blog.csdn.net/lki_suidongdong/article/details/20942977 重点: 实现多级子目录的压缩, ...
- [课程设计]任务进度条&开发日志目录
任务进度条&开发日志目录 周期 时间 任务 Sprint One 11.14 ● Scrum团队分工及明确任务1.0 Sprint One 11.15 ● Scr ...
- 提高PHP开发质量的36个方法(精品)
提高PHP开发质量的36个方法 林涛 发表于:2016-3-25 0:00 分类:26点 标签: 62次 1.不要使用相对路径 常常会看到: require_once('../../lib/some_ ...
- 提高你开发效率的十五个Visual Studio 2010使用技巧
提高你开发效率的十五个Visual Studio 2010使用技巧 相信做开发的没有不重视效率的.开发C#,VB的都知道,我们很依赖VS,或者说,我们很感谢VS.能够对一个IDE产生依赖,说明这个ID ...
- 问题11:web前端开发规范手册(转)
一.规范目的 1.1 概述 ..................................................................................... ...
随机推荐
- MFC DDX_Control 与 DDX_Text
DDX_TEXT()的作用可以理解为把字符串变量和控件的文本(WindowText)关联起来, DDX_Control()的作用可以理解为把变量和控件本身关联起来, DoDataExchange(pD ...
- Oracle中hex和raw的相互转换
可以参考以下语句: select hextoraw(rawtohex('你好')) from dual select utl_raw.cast_to_varchar2(hextoraw('E4BDA0 ...
- activemq修改端口
1.修改TCP 61616端口 cd /apps/svr/activemq/conf cat activemq.xml |grep transportConnector <transportCo ...
- dedecms自定义模块流程
dedecms的自定义模块 1.在dedecms主目录下创建一个模块目录 2.在模块目录下创建如下目录 1 2 3 4 5 6 7 8 9 10 网站根目录/ |-自定义模块 ...
- SQL server 删除日志文件 秒删
直接执行 USE [库名称]GOALTER DATABASE [库名称] SET RECOVERY SIMPLE WITH NO_WAITGOALTER DATABASE [库名称] SET REC ...
- JS----对象的合并与克隆
一. 合并与克隆的差别 1. 克隆是特殊的合并(以空对象作为目标对象,非空对象作为源对象进行合并),克隆要求目标对象与源对象的 constructor相同. 2. 克隆的源对象只有一个,合并的源对象可 ...
- golang 中strconv包用法
链接:https://studygolang.com/articles/5003 http://www.cnblogs.com/golove/p/3262925.html
- SSM项目思路整合NEW2
上接于 https://www.cnblogs.com/shijinglu2018/p/10374541.html ...... 三)客户管理模块开发 说明:其实大致思路差不太多,都是首先根据前端页面 ...
- 尝试解决IDea 启动项目后,后台疯狂输出日志。
今天启动项目的时候,昨天下班前还好好,然后今天就炸了.后台疯狂输出日志.. 就类似这种,大批量的刷.其实项目已经正常启动了,就是疯狂的刷日志. 2019-03-29 08:42:53 [DEBUG] ...
- java的lamda表达式
Java8才支持lamda表达式 lamda是一中函数式编程语言 通过实现模式是匿名内部类 java使用内部类实现接口 首先定义一个接口 @FunctionalInterfaceinterface ...