• 保存地址栏文件名有顺序的图片或网页的小工具


    使用方法:

    将代码粘贴到控制台,然后回车,左上角会出现一个按钮,可以点击按钮切换到下一页。虽然方法或许low,但是实在不愿意更改地址栏那个数字,太不好选择了。

    
    
    var saveImg={
    last:function(){
    var href=window.location.href;
    var line=href.lastIndexOf('/');
    var dot=href.lastIndexOf('.');
    var con=href.slice(0,line+1);
    var last=href.slice(dot);
    var num=href.slice(line+1,dot)/1+1;
    console.log(con+num+last);
    window.location.href=con+num+last;
    },
    appChild:function(){
    var btn = document.createElement("input");//js新建元素
    btn.onclick = this.last;//给元素添加点击事件
    btn.setAttribute("type", "button");//给元素加属性
    btn.setAttribute("value", "下一张");//给元素加属性
    btn.style.position = "fixed";//js设置样式
    btn.style.top = "20px";//js设置样式
    btn.style.left = "20px";//js设置样式
    btn.style.width= "100px";//js设置样式
    btn.style.height = "30px";//js设置样式
    btn.style.fontSize = "20px";//js设置样式
    btn.style.color = "red";//js设置样式
    btn.style.fontWeight = "bold";//js设置样式
    document.body.appendChild(btn);//把元素放进body标签里面
    }
    }
    saveImg.appChild();
     

    haley欢迎您来访本博客。此博客是作者在工作中的一个记事本,方便下次遇到同样问题时,以最快的速度解决掉遇到的问题。如果您发现哪里写的不对,欢迎给我留言,让我们一起进步。不胜感激!
  • 相关阅读:
    基于日志实现ssh服务防护脚本
    给多主机传输文件脚本
    Python map() 函数
    常用希腊字母读法
    Python中Numpy.nonzero()函数
    numpy.eye() 生成对角矩阵
    (sklearn)岭回归 sklearn.linear_model.Ridge用法
    pip配置永久国内源
    python numpy的var std cov研究
    numpy中的mean()函数
  • 原文地址:https://www.cnblogs.com/haley168/p/tools_img.html
Copyright © 2020-2023  润新知