Article Detail

VUE获取视频或音频时长

javaScript: updateTime(){ let s=this.$refs.audio.currentTime;//获取当前播放时间 console....

HTML 阅读 104.5万 1 分钟阅读 2021-01-27 00:04
JavaScript
22 行
<div>
	<audio ref="audio" @timeupdate="updateTime" autoplay controls src=""></audio>
	<video ref="video"
		@canplay="getDuration"
		src=""
		width="80%" height="350"
		controls="controls"
	>
	</video>
</div>

javaScript:

updateTime(){
	let s=this.$refs.audio.currentTime;//获取当前播放时间
	console.log(s)
},

getDuration(){
	let s=this.$refs.video.duration ;//获取视频的总时长
	console.log(s)
},
Comments 评论区
广西桂林市 2021-01-27 00:05

CSS 强制换行和禁止换行强制换行 和禁止换行样式

强制换行

代码片段
3 行
1、word-break: break-all;       只对英文起作用,以字母作为换行依据。
2、word-wrap: break-word;   只对英文起作用,以单词作为换行依据。
3、white-space: pre-wrap;     只对中文起作用,强制换行。

禁止换行

代码片段
3 行
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
| | #0
广西桂林市 2021-01-27 00:08

css3的动画特效--元素旋转(transition,animation)
图标在1秒内匀速旋转360度

代码片段
6 行
.close:hover::before{
    -webkit-transform:rotate(360deg);
    transform:rotate(360deg);
    -webkit-transition:-webkit-transform 1s linear;
    transition:transform 1s linear;
}

一直不停旋转

代码片段
17 行
@-webkit-keyframes spin {
                from {
                    -webkit-transform: rotate(0deg);
                }
                to {
                    -webkit-transform: rotate(360deg);
                }
            }
            
            @keyframes spin {
                from {
                    transform: rotate(0deg);
                }
                to {
                    transform: rotate(360deg);
                }
            }
代码片段
8 行
.close:hover::before {
                /*-webkit-transform: rotate(360deg);
                transform: rotate(360deg);
                -webkit-transition: -webkit-transform 1s linear;
                transition: transform 1s linear;*/
                -webkit-animation: spin 1s linear 1s 5 alternate;
                animation: spin 1s linear infinite;
            }
| | #0
广西桂林市 2021-01-27 00:09
代码片段
14 行
animation动画添加各种参数

(1)infinite参数,表示动画将无限循环。在速度曲线和播放次数之间还可以插入一个时间参数,用以设置动画延迟的时间。如希望使图标在1秒钟后再开始旋转,并旋转两次,代码如下

.close:hover::before{
    -webkit-animation: spin 1s linear 1s 2;
    animation: spin 1s linear 1s 2;
}
(2)alternate参数。animation动画中加入反向播放参数alternate。在加入该参数后,动画将在偶数次数时反向播放动画。

.close:hover::before{
    -webkit-animation: spin 1s linear 1s 2 alternate;
    animation: spin 1s linear 1s 2 alternate;
}
| | #0
广西桂林市 2021-01-27 00:10
article image
| | #0
广西桂林市 2021-01-27 00:12

PHP判断远程文件是否存在

PHP
24 行
<?php
function check_remote_file_exists($url) {
    $curl = curl_init($url); // 不取回数据
    curl_setopt($curl, CURLOPT_NOBODY, true);
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET'); // 发送请求
    $result = curl_exec($curl);
    $found = false; // 如果请求没有发送失败
    if ($result !== false) {
 
        /** 再检查http响应码是否为200 */
        $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        if ($statusCode == 200) {
            $found = true;
        }
    }
    curl_close($curl);
 
    return $found;
}
 
$url = "http://cn.wordpress.org/wordpress-3.3.1-zh_CN.zip";
echo check_remote_file_exists($url); // 返回1,说明存在。
 
?>
| | #0
广西桂林市 2021-01-27 00:13

PHP对Url中的汉字进行编码和解码
url编码(urlencode)

广西桂林市2021-01-27 00:13:49

laravel 使用 composer dumpautoload 配置自动加载文件

GDScript3
9 行
自动加载 //再此运行composer dump-autoload,尝试调用
 
"autoload":{
 
"files":["aa/bb.php”],////不需要命名空间
 
}
 
//files键对应的值是一个数组,数组元素是文件的路径,路径是相对于应用的根目录。加上上述内容后,运行命令:
| | #0
广西桂林市 2021-01-27 00:16

JS 取整、取余

代码片段
20 行
一、取整
1. 取整

// 丢弃小数部分,保留整数部分
parseInt(7/2)  // 3
2. 向上取整

// 向上取整,有小数就整数部分加1
Math.ceil(7/2)  // 4
3. 向下取整

// 向下取整,丢弃小数部分
Math.floor(7/2)  // 3
4. 四舍五入

// 四舍五入
Math.round(7/2)  // 3
二、取余
// 1. 取余
7%2  // 1
| | #0
Comment Form 留下评论
正在回复 #0
粘贴图片、拖拽文件,或点上面的按钮上传 图片会自动插入 [img] 标签,其他附件会自动插入 [attach] 标签。
正在上传...
提交前会先拉起旧项目同款第三方人机验证。

不再要求填写昵称;reply 会生成一条带楼层回链的新评论,quote 会附带完整引用块,并保持评论锚点跳转。

lizhenqiu blog is powered by lizhenqiu.com Version 6.9

Processed in 0.0147 second(s) W3C

本博客的所有原创作品采用 知识共享 署名-非商业性使用-相同方式共享 2.5 协议 进行许可

本站由 七七牛 云存储 阿阿里云 计算与安全服务 拍又拍云 CDN 加速 百百度智能 AAMH 布布集网 AI指南针AI

桂公网安备 45010302000998号 桂ICP备15007619号-1 中国互联网举报中心 建议使用谷歌浏览器浏览
Navigation 文章导航
⌂ ↓ ↑
100%
图片预览
Gallery 图集
0 张图片

正在整理正文和评论里的图片。

当前页还没有可展示的图片。
Quick Comment 快速评论

直接输入内容,提交时仍会走当前页面的人机验证。

正在上传...
操作提示