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(如何提高终极开发效率)的更多相关文章

  1. MS CRM 2011的自定义和开发(11)——插件(plugin)开发(三)

    http://www.cnblogs.com/StoneGarden/archive/2012/02/06/2340661.html MS CRM 2011的自定义和开发(11)——插件(plugin ...

  2. MS CRM 2011的自定义和开发(11)——插件(plugin)开发(四)

    http://www.cnblogs.com/StoneGarden/archive/2012/02/08/2343294.html MS CRM 2011的自定义和开发(11)——插件(plugin ...

  3. MS CRM 2011的自定义和开发(11)——插件(plugin)开发(一)

    http://www.cnblogs.com/StoneGarden/archive/2012/02/02/2336147.html MS CRM 2011的自定义和开发(11)——插件(plugin ...

  4. MS CRM 2011的自定义和开发(11)——插件(plugin)开发(二)

    http://www.cnblogs.com/StoneGarden/archive/2012/02/06/2339490.html MS CRM 2011的自定义和开发(11)——插件(plugin ...

  5. 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 重点: 实现多级子目录的压缩, ...

  6. [课程设计]任务进度条&开发日志目录

    任务进度条&开发日志目录 周期 时间 任务 Sprint One   11.14     ●  Scrum团队分工及明确任务1.0    Sprint One   11.15   ●  Scr ...

  7. 提高PHP开发质量的36个方法(精品)

    提高PHP开发质量的36个方法 林涛 发表于:2016-3-25 0:00 分类:26点 标签: 62次 1.不要使用相对路径 常常会看到: require_once('../../lib/some_ ...

  8. 提高你开发效率的十五个Visual Studio 2010使用技巧

    提高你开发效率的十五个Visual Studio 2010使用技巧 相信做开发的没有不重视效率的.开发C#,VB的都知道,我们很依赖VS,或者说,我们很感谢VS.能够对一个IDE产生依赖,说明这个ID ...

  9. 问题11:web前端开发规范手册(转)

    一.规范目的 1.1  概述 ..................................................................................... ...

随机推荐

  1. 关于delete请求,后台接收不到数据

    在前端用axios需要这样写 /** * 删除数据 */export function del(url, data = {}) { return axios.delete(url, { data: q ...

  2. .net如何引用该命名空间

    一.在.Net中如何引用该命名空间 (1)System.Windows.Threading 该命名空间在程序集WindowsBase(WindowsBase.dll)下 (2)System.Windo ...

  3. 数据结构与算法JS实现

      行解算法题,没错,就是这么方便. 当然也可以使用 Node.js 环境来执行,具体参考Node.js官方文档即可. 二 对象和面向对象编程 js中5种数据类型,并没有定义更多的数据类型,但是运用j ...

  4. jquery datetimepicker 日期时间控件的使用及参数说明

    首先下载 jquery.datetimepicker.css jquery.datetimepicker.main.js 1. 引入css和js (注:该控件要依赖于jquery) <link ...

  5. VS工具箱中添加DevExpress控件

    关闭所有VS进程: ①使用控制台进入DevExpress安装目录: D:\DevExpress\Components\Tools\ ②添加DevExpress控件:ToolboxCreator.exe ...

  6. Fiddler抓包【2】_捕获设置

    1.Fiddler抓web网站请求 手动设置方法一:Tools--->WinINET Options--->连接--->局域网设置--->代理服务器勾选后“高级”---> ...

  7. SSIS Hekaton In-Memory OLTP 【翻译一篇外国文章】

    来自:http://www.itprotoday.com/microsoft-sql-server/important-new-features-sql-server-2014 Microsoft's ...

  8. Kali-Dos洪水攻击之Hping3

    在计算机行业,拒绝服务(DoS)或分布式拒绝服务(DDoS)攻击是指不法分子企图让某机器或网络资源无法被预期的用户所使用.虽然执行DoS攻击的方式.动机和目标不一样,但通常包括设法临时性或无限期中断或 ...

  9. CentOS7中OpenVPN的配置

    最近需要在openstack中集成openvpn功能,故熟悉了一下openvpn的搭建流程,记录下来,供参考 版本:openvpn-2.3.4.tar.gz 下载地址:http://pan.baidu ...

  10. Halcon一维运算相关算子整理

    Halcon一维离散函数算子 1.      abs_funct_1d  计算一维数组的绝对值 2.      compose_funct_1将两个离散的一维函数合并为一个函数 3.      cre ...