计科知识库
  • 源界面
  • 博客圈
  • 专题
  • 博友
  • 登录
  • 注册

专题:js

列表

  • 源界面 源界面 9天前
    js实现图片压缩上传
    js实现图片压缩上传

    javascript 处理图片压缩、剪切、模糊和上传一:js脚本实现图片压缩 - CompressImageUtiles 特点:1 体积小,4kb;2 支持blob格式上传和base64格式上传 1. // html2. <input type="file" id="input-img">3. 4. //引入脚本5. <script src="./CompressImageUtiles.js"></script>6. 7. 8. <script>9. /**10. * 支持blob格式上传和base64格式上传11. * */ 12. let inputDom = document.querySelector('#input-img')13. inputDom.onchange = function(){14. const fileObj = input

  • 源界面 源界面 6天前
    一个JS代码写的,实现打开调试或开发工具就关掉网页
    一个JS代码写的,实现打开调试或开发工具就关掉网页

    :一个JS代码写的,实现打开调试或开发工具就关掉网页功能是,只要打开web调试工具什么的,网站就关掉了。。。。 <script type="text/javascript">// 定义尝试关闭当前窗口并导航至空白页的函数function fuckyou() { window.close(); // 尝试关闭当前窗口 window.location = "about:blank"; // 导航至空白页}// 使用console的profile方法来检测调试function ck() { console.profile(); console.profileEnd(); if (console.clear) { console.clear(); }; if (typeof console.profiles == "object") {

  • 源界面 源界面 3天前
    显示选择图片的缩略图

  • 源界面 源界面 3天前
    选择图片后显示缩略图(自动生成缩略图)
    选择图片后显示缩略图(自动生成缩略图)

    选择图片后显示缩略图(自动生成缩略图) <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>显示选择图片的缩略图</title> <style> #dropbox { width: 200px; height: 70px; line-height: 70px; text-align: center; border: 2px dashed #999; border-radius: 5px; background: #fbfbfb; color: #666; } #preview>img { height: 80px; mar

  • 源界面 源界面 3天前
    一串js篇的广告后载入代码

    一串js篇的广告后载入代码选对了广告。有时我们也要让内容优先展示出来,后再加载广告内容。这样让我们的网站能更加快速的展现在用户面前。ok,话不多说啦,现在贴出自己保存存档的一串代码,优先肉容后加载广告,代码好下: <div id="mylater_ads">载入中...</div><div id="myadsbox">这里放广告代码</div><script type="text/javascript">document.getElementById("mylater_ads").innerHTML = document.getElementById("myadsbox").innerHTML;document.getElementById("myadsbox").innerHTML = "";</script><p>代码来源 <a href="http://www.pengchao.

  • 源界面 源界面 3天前
    JS实现点击按钮复制 input 标签中的值到剪贴板

    JS实现点击按钮复制 input 标签中的值到剪贴板 JS实现点击按钮复制input 标签中的值到剪贴板 这是一串能让你省敲键盘按键的小代码。今天为了实现一个上传小程序增加的一个代码片断,很实用的小功能 。 <div id="div"> <p>我的推广链接:</p> <input id="input666" value="http://www.csroad.cn" readonly/> <button onclick="copyUrl()">点击复制链接</button></div>function copyUrl() { var Url=document.getElementById("input666"); Url.select(); // 选择对象 document.execComman

  • 上一页
  • 1
  • 下一页
  • © 2025 源界面 源码为笔,博客为路,写就数字未来
  • 建议
  • 图片压缩
  • | 鄂ICP备14016484号-6

    鄂公网安备 42068402000140