zoukankan      html  css  js  c++  java
  • pop弹窗

    ** PopFn  //弹窗,第一个参数是显示的文字(可以是HTML代码),第二和第三个参数是第一个按钮,和按钮的链接(可以是javascript函数),第四和第五个按钮是同上。如不需要右上方的关闭按钮,添加最后一个参数"noclose";
    ** PopFnClose  关闭弹窗函数

    function PopFn(){
        var arr=[];
        arr.push("<div class='PopMark'></div>")
        arr.push("<div class='Pop' style='display:none;'>")
            arr.push("<div class='Pop_title'>")
                arr.push("<span class='title'>提示信息</span>")
                arr.push("<span class='close'>×</span>")    
            arr.push("</div>")
            arr.push("<div class='popNr'>")
                arr.push("<div class='popcon'></div>")
                arr.push("<div class='popBtn'>")
                    arr.push("<a href='' class='btnFirst'></a>&nbsp;&nbsp;")
                    arr.push("<a href='' class='btnSecond'></a>")
                arr.push("</div>")
            arr.push("</div>")
        arr.push("</div>")
        $("body").append($(arr.join("")))
        $(".Pop_title .close").click(function(){
            PopFnClose()
        });    
        if(arguments[arguments.length-1]=="noclose"){
            $(".Pop_title .close").css("display","none")
        }else{
            $(".Pop_title .close").css("display","block")
        }
        $(".PopMark").css({"display":"block","width":$(document).width()+"px","height":$(document).height()+"px"}).animate({opacity:"0.5"},200);
        $(".Pop").css({"top":"300px","left":($(window).width()-382)/2+"px","display":"block"});
        $(".Pop .popcon").html(arguments[0]);
        if(arguments[1]&&arguments[1]!="noclose"){
            if(arguments[3]&&arguments[3]!="noclose"){
                $(".Pop .popBtn a").eq(0).attr("href",arguments[2]).html(arguments[1])
                $(".Pop .popBtn a").eq(1).attr("href",arguments[4]).html(arguments[3])
            }else{
                $(".Pop .popBtn a").eq(1).attr("href",arguments[2]).html(arguments[1])
                $(".Pop .popBtn a").eq(0).remove()
            }
        }else{
            $(".Pop .popBtn").remove()
        }
    }    
    function PopFnClose(){
      $(".Pop,.PopMark").remove()
    }

  • 相关阅读:
    类的继承,抽象类和接口
    什么是CGI、FastCGI、PHP-CGI、PHP-FPM、Spawn-FCGI?
    php 中 SERVER 服务器参数
    数组与对象互换方法
    php实现二维数组查找功能【array_search 和 array_column】
    php基础知识点列表【2020年10月7日】
    json_encode 中文及特殊斜杆的编码
    吴裕雄--天生自然ANDROID开发学习:2.5.8 Notification(状态栏通知)详解
    吴裕雄--天生自然ANDROID开发学习:2.5.7 Toast(吐司)的基本使用
    吴裕雄--天生自然ANDROID开发学习:2.5.6 ViewFlipper(翻转视图)的基本使用
  • 原文地址:https://www.cnblogs.com/lglijing/p/3615909.html
Copyright © 2011-2022 走看看