emlog侧边栏添加新浪图床上传样式及接口

2018-06-07 16:19:10 浏览数 (1)

有几个友友想要我右侧栏的新浪图床上传样式,今天分享给大家

代码语言:javascript复制
<style type="text/css">
#file{position:absolute;z-index:1;cursor:pointer;opacity:0;}
#file,.btn_mouseout{background:#6F8EC5;color:#FFF;display:block;line-height:37px;text-align:center;width:100%;}
#sinaimg{width:50%;padding-bottom: 25px;}
#sinaimgurl{background: rgba(255, 0, 0, 0);padding: 5px;line-height: 31px;border: 1px solid #ddd;width: 286px;color: #999;border-radius: 4px;}
#img{text-align: center;width: 100%}
.upload-drag{
  position: relative;
  padding: 30px;
  border: 1px dashed #e2e2e2;
  background-color: #fff;
  text-align: center;
  cursor: pointer;
  color: #999;
}
</style>
<script type="text/javascript" src="//www.youngxj.cn/content/templates/emedia_better/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="//www.youngxj.cn/content/templates/emedia_better/layer/layer.js"></script>
<form id="form1">
  <div class="upload-drag" id="upload-drag" onclick="file.click()" title="点击上传图片">
    <img src="https://ww2.sinaimg.cn/large/843dc74bgy1fpkedpgq3tj201c01c0of.jpg">
<p id="stat">点击上传</p>
    <input type="file" id="file" name="file" onchange="sc();" style="display:none" accept="image/*"/>  
  </div>
</form>
<div id="img"></div>
<div id="imgurl"></div>
<script type="text/javascript" src="//www.youngxj.cn/content/templates/emedia_better/js/sinaup.js"></script>

因为layer.js存在跨域问题,所以最好自己到官方下载一份layer到自己博客,然后进行调用即可

0 人点赞