随笔分类 -  javascript

摘要:$(function (){ var eleImg = document.querySelector('#image'); var store = { scale: 1 }; // 缩放处理 eleImg.addEventListener('touchstart', function (event) 阅读全文
posted @ 2022-12-06 10:24 赵瑛 阅读(627) 评论(0) 推荐(0) 编辑
摘要:子页面1 function abcd(data) { alert(data); } 子页面2 parent.parent.$("#子页面1的iframe名称")[0].contentWindow.abcd(data); 要注意的是,子页面2在传值给子页面1时,一定要有两个parent。 阅读全文
posted @ 2022-08-17 11:22 赵瑛 阅读(78) 评论(0) 推荐(0) 编辑
摘要:let str = ‘张三>李四>王五’ 截取最后一个>前面的字符串 let index = str .lastIndexOf(">") str =str .substring(0,index); console.log(str) //张三>李四 截取最后一个>后面的字符串 let index = 阅读全文
posted @ 2022-08-02 09:14 赵瑛 阅读(5006) 评论(0) 推荐(0) 编辑
摘要:1、父窗口设置input输入框 <input type='hidden' id='cz' name='cz' value='1'/> 2、子窗口设置父窗口输入框值 $("#cz" , window.parent.document).val('2'); // 传给父窗口 parent.layer.cl 阅读全文
posted @ 2022-06-15 20:22 赵瑛 阅读(440) 评论(0) 推荐(0) 编辑
摘要:<audio id="bgmusic" src="/static/media/flipsound.mp3" preload></audio> // audio音频 var audio = document.getElementById("bgmusic"); if (typeof WeixinJSB 阅读全文
posted @ 2022-05-25 09:55 赵瑛 阅读(557) 评论(0) 推荐(0) 编辑
摘要:.error {border:#ff0000 1px solid;background: rgba(195,5,5,.2);}<form action="#" method="post" onsubmit="return checkForm(this);"> </form> function che 阅读全文
posted @ 2022-05-24 16:38 赵瑛 阅读(112) 评论(0) 推荐(0) 编辑
摘要:var url = 'http://www.cdlyh.com/down.php'; var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); // 也可以使用POST方式,根据接口 xhr.responseType = "blob"; 阅读全文
posted @ 2021-08-21 10:24 赵瑛 阅读(183) 评论(0) 推荐(0) 编辑
摘要:<video id=“vid”> <source src="./video.mp4"></video> //尽量这样写 别直接再video中写src 那样会出现啊兼容性问题 <div class="time1">00:00:00</div> //视频播放时间 <div class="time1">8 阅读全文
posted @ 2021-08-10 11:34 赵瑛 阅读(277) 评论(0) 推荐(0) 编辑
摘要:1 <script type="text/javascript"> 2 $(function(){ 3 /*进入子元素也触发*/ 4 /*$('#div1').mouseover(function() { 5 $(this).animate({marginTop: 50});//.stop() 6 阅读全文
posted @ 2021-08-06 14:52 赵瑛 阅读(388) 评论(0) 推荐(0) 编辑
摘要:var url; url = window.location.href; /* 获取完整URL */ alert(url); /* http://127.0.0.1:8020/Test/index.html#test?name=test */ url = window.location.pathna 阅读全文
posted @ 2021-04-14 11:38 赵瑛 阅读(225) 评论(0) 推荐(0) 编辑

版权所有 © 2022 沅来是澧

如果有程序开发、网站建设等需求的请联系我,QQ:47419233

点击右上角即可分享
微信分享提示