h5标签

1.vedio



去掉播放按钮
video::-internal-media-controls-download-button {
    display:none;
}
video::-webkit-media-controls-enclosure {
    overflow:hidden;
}




video::-webkit-media-controls-panel {
    width: calc(100% + 30px); 

}

img

1.
onerror()事件
触发图片资源没有触发到的时候---触发的事件
<img src="" onerror="HCcommon.errorImg(this,'logo.png')">

iframe

在本地服务器上,相对路径的视频是不可以打开视频的,




在iframe同级的标签的页面,怎样访问iframe里面的内容,


iframe访问
window.iframe[0]

window.iframe[id]
每次都加上name才可以不知到为什么、


父页面控制iframe的事件
window.frames[0].eventHandler.changeFontSize(fontSizecan);


子页面控制父元素的页面

select

select 默认被选中


 获取被选中的option的值 $(".selector").find("option:selected").data("")
  获取被选中的option的值$(".selector").find("option:selected").text();
获取当前的$(".selector".)val()
改变select倒三角样式
select {
  /*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/
  border: solid 1px #000;


  /*很关键:将默认的select选择框样式清除*/
  appearance:none;
  -moz-appearance:none;
  -webkit-appearance:none;


  /*在选择框的最右侧中间显示小箭头图片*/
  background: url("http://ourjs.github.io/static/2015/arrow.png") no-repeat scroll right center transparent;




  /*为下拉小箭头留出一点位置,避免被文字覆盖*/
  padding-right: 14px;
}




/*清除ie的默认选择框样式清除,隐藏下拉箭头*/
select::-ms-expand { display: none; }
background-position: right 10px top 20px,

canvas

todataUrl存在画布污染的问题
当出现浏览器出现
ncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. at Image.answer.pictureCompress.img.onload


前端需要加https://www.cnblogs.com/ajg016/p/5477557.html
                var img=new Image();
                var timestamp = new Date().getTime();
                img.setAttribute('crossOrigin', 'anonymous');
                img.src =$(".tuya").attr("src") + '?' + timestamp;
前端加了以后出现了
Access to Image at 'http://ees-paper-image.oss-cn-hangzhou.aliyuncs.com/57205203.21171116/201/57205203170810_1.gif?x-oss-process=image/crop,x_248,y_1060,w_1324,h_900?1513394569327' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 400.
后台也要加



canvas 好的文章

https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement/toDataURL


http://cuihuan.net/2015/11/23/canvas_combine_pic/


http://www.jianshu.com/p/17d7e5ddf10a


https://www.cnblogs.com/web-wjg/p/7779513.html


http://www.zhangxinxu.com/wordpress/2017/07/html5-canvas-image-compress-upload/


https://segmentfault.com/q/1010000005002725




http://hongru.github.io/proj/canvas2image/index.html
 
https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORS
 
https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image


 





猜你喜欢

转载自blog.csdn.net/houdabiao/article/details/79956949