jq轻松完结切换隐藏与展现同时切换Logo,div上下切换

HTML代码:

正文实例为我们介绍了javascript图片切换的两种方法,循环切换以及种种切换的实例代码,分享给我们供大家参考,具体内容如下

<!DOCTYPE html>
<html>

 <head>
  <meta charset="utf-8" />
  <title>div上下切换</title>
  <link rel="stylesheet" href="css/cssreset-min.css" />
  <link rel="stylesheet" href="css/storemanage.css" />
  <script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
  <script type="text/javascript" src="js/tips.js"></script>
  <script type="text/javascript" src="js/storemanage.js"></script>
 </head>

 <body>
  <div class="fwge">
   <div class="fwge_lanmu clearfix">
    <div class="fwge_lanmu_left">名称</div>
    <div class="fwge_lanmu_right">操作</div>
   </div>
   <div class="fwge_main">
    <div class="fuge_content">
     <div class="banner_bottom">
      <div class="fuge_content_input">
       <div class="fuge_block">
        <input class="fuge_item" maxlength="30">
        <div class="fuge_count">
         0/30
        </div>
       </div>
      </div>
      <div class="fuge_content_cz clearfix">
       <div class="fuge_top"></div>
       <div class="fuge_down"></div>
       <div class="fuge_sc picflag"></div>
      </div>
     </div>
    </div>
   </div>
   <div class="fuge_add">+添加规格</div>
  </div>
 </body>

</html>
<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8" />
        <title>div上下切换</title>
        <link rel="stylesheet" href="css/cssreset-min.css" />
        <link rel="stylesheet" href="css/storemanage.css" />
        <script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="js/tips.js"></script>
        <script type="text/javascript" src="js/storemanage.js"></script>
    </head>

    <body>
        <div class="fwge">
            <div class="fwge_lanmu clearfix">
                <div class="fwge_lanmu_left">名称</div>
                <div class="fwge_lanmu_right">操作</div>
            </div>
            <div class="fwge_main">
                <div class="fuge_content">
                    <div class="banner_bottom">
                        <div class="fuge_content_input">
                            <div class="fuge_block">
                                <input class="fuge_item" maxlength="30">
                                <div class="fuge_count">
                                    0/30
                                </div>
                            </div>
                        </div>
                        <div class="fuge_content_cz clearfix">
                            <div class="fuge_top"></div>
                            <div class="fuge_down"></div>
                            <div class="fuge_sc picflag"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="fuge_add">+添加规格</div>
        </div>
    </body>

</html>
<!doctype html>
<html>
<head>  
<meta charset=" utf-8">  
<title>jq隐藏显示图标切换</title>
  <!--引入jq文件-->
<script type="text/javascript" scr="./js/jquery.min.js"></script>
</head>
<body>
<!--隐藏/显示 控制按钮-->
<div><img id="ctr" scr="./images/01.jpg"></div>
<!--被控制元素-->
<p id="info" style="display:none;">这里是要显示或隐藏的内容</p>
</body>
</html>        
<html>
  <head>
    <meta charset="utf-8">
    <style>
    p{margin:0;}
    input{border:none;outline: none;margin:0;padding:0;}
     img{width:300px;height:300px;}
     #loop{margin-left:50px;background:#c80;width:60px;height:40px;font-size:14px;line-height:20px;text-align: center;}
     #order{margin-left:50px;background:#c80;width:60px;height:40px;font-size:14px;line-height:20px;text-align:center;}
     div{width:300px;height:300px;position:relative;}
     span{position:absolute;left:0;top:0;width:300px;height:20px;font-size:14px;line-height:20px;background:#000;opacity:0.5;color:#fff;text-align: center;}
     div p{position:absolute;left:0;bottom:0;width:300px;height:20px;font-size:14px;line-height:20px;text-align: center;color:#fff;background:#000;opacity:0.5;}
     div input{position:absolute;width:60px;height:60px;top:100px;background:pink;}
     #back{left:0;}
     #next{right:0;}
    </style>
    <script type="text/javascript">
     window.onload=function(){
      //循环切换
      var oNext=document.getElementById("next");
      var oBack=document.getElementById("back");
      var oImg=document.getElementById("img");
      var oText=document.getElementById("text");
      var oSpan=document.getElementById("span");
      var oLoop=document.getElementById("loop");
      var Oorder=document.getElementById('order');
      var oText1=document.getElementById("text1");
      var aImg=["img/1.jpg","img/2.jpg","img/3.jpg","img/4.jpg"];
      var aText=["图片1","图片2","图片3","图片4"];

      var num=0;
      //点击下一张事件
      function next(){
        num=num+1; //每次加一
        //进行判断,如果num大于最后一张时,图片返回第一张
        //// 1 2 3 4
        if(num>aImg.length-1){

          num=0;
        }
        oImg.src=aImg[num];
        oText.innerHTML=aText[num];//图片信息变化,与数组关联
        oSpan.innerHTML=(num+1)+"/"+aImg.length;//数量变化,与数组关联
        //alert(num);

      }
       function back(){
        num=num-1;
        //进行判断,如果图片小于第一张时,图片返回最后一张
        if(num<0){
          num=aImg.length-1;
        }
        oImg.src=aImg[num];
        oText.innerHTML=aText[num];//图片信息变化,与数组关联
        oSpan.innerHTML=(num+1)+"/"+aImg.length;//数量变化,与数组关联
      }
      function next1(){
        num=num+1; //每次加一
        //进行判断,如果num大于最后一张时,弹出警告并把图片定在最后一张
        //// 1 2 3 4
        if(num>aImg.length-1){

          num=aImg.length-1;
          alert("最后一张了");
        }
        oImg.src=aImg[num];
        oText.innerHTML=aText[num];
        oSpan.innerHTML=num+1+"/"+aImg.length;
        //alert(num);

      }
      function back1(){
        num=num-1;
        //进行判断,如果图片小于第一张时,弹出警告并把图片定在第一张
        if(num<0){
          num=0;
          alert("已经是第一张了");
        }
        oImg.src=aImg[num];
        oText.innerHTML=aText[num];
        oSpan.innerHTML=num+1+"/"+aImg.length;
      }

      oNext.onclick=next;
      oBack.onclick=back;
      oLoop.onclick=function(){
          oText1.innerHTML="图片可以从第一张到最后一张循环切换";
          oNext.onclick=next;
          oBack.onclick=back;
      }
      Oorder.onclick=function(){
         oText1.innerHTML="图片只能从第一张到最后一张顺序切换";
        oNext.onclick=next1;
        oBack.onclick=back1;

      }


     }

    </script>
  </head>
  <body>
    <input id="loop" type="button" name="" value="循环切换"/>
    <input id="order"type="button" name="" value="顺序切换"/>
    <p id="text1">图片可以从第一张到最后一张循环切换</p>
   <div>
    <input id="back" type="button" name="" value="上一张"/>
    <input id="next" type="button" name="" value="下一张"/>

      <img id="img" src="img/1.jpg"/>
      1/4
      <p id="text">图片1</p>
   </div>


  </body>
</html>

  jQuery代码:

  jQuery代码:

JS代码:

图表切换即两张图纸轮流切换代码:

$(function() {
 //规格文本框字数提示代码
 var lenInput = $(".fuge_content").find('.fuge_item').val().length;
 $(".fuge_item").keyup(function() {
  lenInput = $(this).val().length;
  var str = $(this).siblings().find(".textareaInput");
  if(lenInput >= 0 && lenInput <= 30) {
   $(str).html(lenInput);
  }
 });

 //添加服务规格追加代码
 var lifwge='<div class="banner_bottom">'+
     '<div class="fuge_content_input">'+
      '<div class="fuge_block">'+
                '<input class="fuge_item" maxlength="30">'+
                '<div class="fuge_count">'+
                    '0/30'+
                '</div>'+
            '</div>'+
     '</div>'+
     '<div class="fuge_content_cz clearfix">'+
      '<div class="fuge_top"></div>'+
      '<div class="fuge_down"></div>'+
      '<div class="fuge_sc picflag"></div>'+
     '</div>'+
    '</div>';

 //添加服务规格(最多添加4条规格)
 $(".fwge").on("click", ".fuge_add", function() {
  var bannerSize = $(".banner_bottom").size();
  if(bannerSize >= 4) {
   $.tips.tip("最多添加服务规格4条", function() {
    $.tips.close();
   });
  } else {
   $(".fuge_content").append(lifwge);
   var lenInput = $(".fuge_content").find('.fuge_item').val().length;
   $(".fuge_item").keyup(function() {
    lenInput = $(this).val().length;
    var str = $(this).siblings().find(".textareaInput");
    if(lenInput >= 0 && lenInput <= 30) {
     $(str).html(lenInput);
    }
   });
  }
 });

 //删除服务规格(至少存在2条规格)
 $(".fwge").on("click", ".fuge_sc", function() {
  var bannerSize = $(".banner_bottom").size();
  if(bannerSize <= 1) {
   $.tips.tip("服务规格不能小于一条",function(){
                $.tips.close();
            });
  } else {
   $(this).parent().parent(".banner_bottom").remove();
  }
 });

 //规格向下移动
 $(".fwge").on("click",".fuge_down",function(){
  var box = $(this).parent().parent(); //获取按钮的父元素
  var box_next = box.next(); //父元素的下一个同胞元素
  var box_next_left = parseInt(box_next.css('top')); //父元素下一个同胞元素的top值
  var box_left = parseInt(box.css('top')); //父元素的top值
  if(box_next_left) {
   box.animate({
    top: box_next_left.toString()
   });
   box_next.animate({
    top: box_left.toString()
   });
   box.insertAfter(box_next);
  }
 });

 //规格向上移动
 $(".fwge").on("click",".fuge_top",function(){
  var box = $(this).parent().parent(); //获取按钮的父元素
  var box_left = parseInt(box.css('top')); //父元素的top值
  var box_prev = box.prev(); //父元素的上一个同胞元素
  var box_prev_left = parseInt(box_prev.css('top')); //父元素下一个同胞元素的top值
  if(box_left) {
   box.animate({
    top: box_prev_left.toString()
   });
   box_prev.animate({
    top: box_left.toString()
   });
   box.insertBefore(box_prev);
  }
 });
});
$(function() {
    //规格文本框字数提示代码
    var lenInput = $(".fuge_content").find('.fuge_item').val().length;
    $(".fuge_item").keyup(function() {
        lenInput = $(this).val().length;
        var str = $(this).siblings().find(".textareaInput");
        if(lenInput >= 0 && lenInput <= 30) {
            $(str).html(lenInput);
        }
    });

    //添加服务规格追加代码
    var lifwge='<div class="banner_bottom">'+
                    '<div class="fuge_content_input">'+
                        '<div class="fuge_block">'+
                            '<input class="fuge_item" maxlength="30">'+
                            '<div class="fuge_count">'+
                                '0/30'+
                            '</div>'+
                        '</div>'+
                    '</div>'+
                    '<div class="fuge_content_cz clearfix">'+
                        '<div class="fuge_top"></div>'+
                        '<div class="fuge_down"></div>'+
                        '<div class="fuge_sc picflag"></div>'+
                    '</div>'+
                '</div>';

    //添加服务规格(最多添加4条规格)
    $(".fwge").on("click", ".fuge_add", function() {
        var bannerSize = $(".banner_bottom").size();
        if(bannerSize >= 4) {
            $.tips.tip("最多添加服务规格4条", function() {
                $.tips.close();
            });
        } else {
            $(".fuge_content").append(lifwge);
            var lenInput = $(".fuge_content").find('.fuge_item').val().length;
            $(".fuge_item").keyup(function() {
                lenInput = $(this).val().length;
                var str = $(this).siblings().find(".textareaInput");
                if(lenInput >= 0 && lenInput <= 30) {
                    $(str).html(lenInput);
                }
            });
        }
    });

    //删除服务规格(至少存在2条规格)
    $(".fwge").on("click", ".fuge_sc", function() {
        var bannerSize = $(".banner_bottom").size();
        if(bannerSize <= 1) {
            $.tips.tip("服务规格不能小于一条",function(){
                $.tips.close();
            });
        } else {
            $(this).parent().parent(".banner_bottom").remove();
        }
    });

    //规格向下移动
    $(".fwge").on("click",".fuge_down",function(){
        var box = $(this).parent().parent(); //获取按钮的父元素
        var box_next = box.next(); //父元素的下一个同胞元素
        var box_next_left = parseInt(box_next.css('top')); //父元素下一个同胞元素的top值
        var box_left = parseInt(box.css('top')); //父元素的top值
        if(box_next_left) {
            box.animate({
                top: box_next_left.toString()
            });
            box_next.animate({
                top: box_left.toString()
            });
            box.insertAfter(box_next);
        }
    });

    //规格向上移动
    $(".fwge").on("click",".fuge_top",function(){
        var box = $(this).parent().parent(); //获取按钮的父元素
        var box_left = parseInt(box.css('top')); //父元素的top值
        var box_prev = box.prev(); //父元素的上一个同胞元素
        var box_prev_left = parseInt(box_prev.css('top')); //父元素下一个同胞元素的top值
        if(box_left) {
            box.animate({
                top: box_prev_left.toString()
            });
            box_prev.animate({
                top: box_left.toString()
            });
            box.insertBefore(box_prev);
        }
    });
});
$(document).ready(function(){
//通过id="ctr"获取元素click事件
     $("#ctr").click(function(){
//将显示和隐藏两个状态下的显示图标路径放入images变量中
       var images=['./images/01.jpg','./images/02.jpg'];
//通过class的值来判断控制显示的图标样式
       if($("#ctr").attr("class")=="down"){
        $("#ctr").attr("src",images[0]);
        $("#ctr").removeClass();
        }else{
        $("#ctr").attr("src",images[1]);
        $("#ctr").addClass("down");
        }
//用于控制元素的隐藏或显示 主要方法toggle(),300是控制元素显示或隐藏的速度
        $("#info").toggle(300);
    });   
});    
<html lang="en">
  <head>
    <meta charset="utf-8">
    <style>
     #text{width:200px;height:200px;font-size:40px;line-height:40px;text-align: center;}
     img{width:200px;height:200px;}
    </style>
    <script type="text/javascript">
     window.onload=function(){
      var oBtn=document.getElementById("btn");
      var oImg=document.getElementById("img");
      var oText=document.getElementById("text");
      var onOff=true;
      oBtn.onclick=function(){
        if(onOff){
         oImg.src="img/7.jpg";
         oText.innerHTML="图片2";
         onOff=false;
        }
        else{
          oImg.src="img/5.jpg";
          oText.innerHTML="图片1";
          onOff=true;
        }
      }

    }
    </script>
  </head>
  <body>
    <input id="btn" type="button" name="" value="切换图片"/>
    <img id="img" src="img/5.jpg"/>
    <p id="text">图片1</p>

  </body>
</html>

  css代码:

澳门葡京,jq轻松完结切换隐藏与展现同时切换Logo,div上下切换。  css代码:

上述的就是落到实处 隐藏/显示效果的大意流程,因为自个儿是生手有个别不完美的地点还请多多蕴涵。

上述便是本文的全体内容,希望对大家的求学javascript程序设计具备协理。

.fwge{
 width: 500px;
 height: 300px;
 margin-left: 10px;
 border: 1px solid #e4e4e4;
}

.fwge_lanmu{
 width: 500px;
 height: 25px;
}

.fwge_lanmu_left{
 width: 350px;
 height: 25px;
 float: left;
}

.fwge_lanmu_right{
 width: 150px;
 height: 25px;
 float: left;
 text-align: center;
}

.fuge_content{
 width: 500px;
 height: auto;
 display: table;
}

.banner_bottom{
 width: 500px;
    height: 30px;
    top:30px;
    margin-bottom: 10px;
}

.fuge_content_input{
 width: 350px;
 height: 30px;
 float: left;
}

.input_text{
 width: 300px;
 height: auto;
 outline: none;
}

.fuge_content_cz{
 width: 150px;
 height: 30px;
 float: left;
}

.fuge_top{
 width: 25px;
    height: 30px;
    float: left;
    margin-left: 20px;
    background: url(../images/tongke_service_icon.png) no-repeat 6px -96px;
}


.fuge_down{
 width: 25px;
    height: 30px;
    float: left;
    margin-left: 20px;
    background: url(../images/tongke_service_icon.png) no-repeat -19px -96px;
}

.fuge_sc{
 width: 25px;
    height: 30px;
    float: left;
    margin-left: 20px;
    background: url(../images/tongke_service_icon.png) no-repeat -44px -96px;
}

.fuge_block {
 position: relative;
}

.fuge_item {
 width: 290px;
 height: 15px;
 border: 1px solid #ccc;
 padding: 6px;
 resize: none;
 outline: none;
}

.fuge_items {
 width: 290px;
 height: 15px;
 border: 1px solid #ccc;
 padding: 6px;
 resize: none;
 outline: none;
}

.fuge_count {
 position: absolute;
 bottom: 5px;
 right: 60px;
 color: #999;
}

.fuge_add{
 width: 70px;
    height: 20px;
    color: #00b1bb;
    line-height: 20px;
    cursor: pointer;
} 
.fwge{
    width: 500px;
    height: 300px;
    margin-left: 10px;
    border: 1px solid #e4e4e4;
}

.fwge_lanmu{
    width: 500px;
    height: 25px;
}

.fwge_lanmu_left{
    width: 350px;
    height: 25px;
    float: left;
}

.fwge_lanmu_right{
    width: 150px;
    height: 25px;
    float: left;
    text-align: center;
}

.fuge_content{
    width: 500px;
    height: auto;
    display: table;
}

.banner_bottom{
    width: 500px;
    height: 30px;
    top:30px;
    margin-bottom: 10px;
}

.fuge_content_input{
    width: 350px;
    height: 30px;
    float: left;
}

.input_text{
    width: 300px;
    height: auto;
    outline: none;
}

.fuge_content_cz{
    width: 150px;
    height: 30px;
    float: left;
}

.fuge_top{
    width: 25px;
    height: 30px;
    float: left;
    margin-left: 20px;
    background: url(..tongke_service_icon.png) no-repeat 6px -96px;
}


.fuge_down{
    width: 25px;
    height: 30px;
    float: left;
    margin-left: 20px;
    background: url(..tongke_service_icon.png) no-repeat -19px -96px;
}

.fuge_sc{
    width: 25px;
    height: 30px;
    float: left;
    margin-left: 20px;
    background: url(..tongke_service_icon.png) no-repeat -44px -96px;
}

.fuge_block {
    position: relative;
}

.fuge_item {
    width: 290px;
    height: 15px;
    border: 1px solid #ccc;
    padding: 6px;
    resize: none;
    outline: none;
}

.fuge_items {
    width: 290px;
    height: 15px;
    border: 1px solid #ccc;
    padding: 6px;
    resize: none;
    outline: none;
}

.fuge_count {
    position: absolute;
    bottom: 5px;
    right: 60px;
    color: #999;
}

.fuge_add{
    width: 70px;
    height: 20px;
    color: #00b1bb;
    line-height: 20px;
    cursor: pointer;
} 

你恐怕感兴趣的小说:

  • 灵活运用数组制作图纸切换js落成
  • js组件SlotMachine落成图片切换效果制作抽取奖品系统
  • js达成索引图片切换效果
  • js鼠标点击图片切换效果得以达成代码
  • js带前后翻页的图样切换效果代码分享
  • js+div实现文字滚动和图表切换效果代码
  • js鼠标点击图片切换效果代码分享
  • JS实现FLASH幻灯片图片切换效果的章程
  • jQuery图片切换插件jquery.cycle.js使用示例
  • js完成图片切换(动画版)

 

 

集体样式css:

公物样式css:

html {
 color: #333;
 background: #FFF;
 min-height: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    min-width: 1200px;
}
input, textarea, keygen, select, button{
 font-family:"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
 Helvetica, Arial, sans-serif;
}

body{
 overflow-y: scroll;
 font-size: 14px;
 font-family:"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
 Helvetica, Arial, sans-serif;
 min-width:1200px;
 position:relative\9;
 min-height: 100%;
}

.tk_footermain {  /*公共代码: 当内容不满一屏时,底部footer内容始终位于显示屏的底部;当内容超过一屏时,则位于内容底部。 */
 height: auto;
 min-height: 100%;
 _height: 100%;
}

body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td,
button
{
 margin: 0;
 padding: 0;
}
textarea{
 resize:none;
}
table {
 border-collapse: collapse;
 border-spacing: 0
}

fieldset,
img {
 border: 0
}

ol,
ul {
 list-style: none
}

caption,
th {
 text-align: left
}

h1,
h2,
h3,
h4,
h5,
h6 {
 font-size: 100%;
 font-weight: normal
}

q:before,
q:after {
 content: ''
}

abbr,
acronym {
 border: 0;
 font-variant: normal
}

sup {
 vertical-align: text-top
}

sub {
 vertical-align: text-bottom
}

input,
textarea,
select,
button
{
 font-family: inherit;
 font-size: inherit;
 font-weight: inherit
}

input,
textarea,
select {
 *font-size: 100%
}

legend {
 color: #000
}

/*html5*/
article, aside, dialog, footer, header, section, footer, nav, figure, menu {
 display: block;
}

/*清浮动*/
.clearfix:after,.clearfix:after {
 content: '.';
 display: block;
 height: 0;
 clear: both;
 visibility: hidden;
}

.clearfix {
 display: inline-block;
}

* html .clearfix {
 height: 1%;
}

.clearfix {
 display: block;
}



/*锚链接初始化*/
a {
 text-decoration: none;
 outline: none;
 color:#5d5d5d;
}

a:hover {
 text-decoration: none;
}

a:focus {
 outline: none;
 -moz-outline: none;
}

/*布局样式*/
.tc{
 text-align:center;
}
.fl {
 float: left;
 display: inline;
}

.fr {
 float: right;
 display: inline;
}
.pr {
 position: relative;
}

.pa {
 position: absolute;
}
.hide{
 display:none;
}
.show{
 display:block;
}
html {
    color: #333;
    background: #FFF;
    min-height: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    min-width: 1200px;
}
input, textarea, keygen, select, button{
    font-family:"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
}

body{
    overflow-y: scroll;
    font-size: 14px;
    font-family:"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
    min-width:1200px;
    position:relative\9;
    min-height: 100%;
}

.tk_footermain {  /*公共代码: 当内容不满一屏时,底部footer内容始终位于显示屏的底部;当内容超过一屏时,则位于内容底部。 */
    height: auto;
    min-height: 100%;
    _height: 100%;
}

body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td,
button
{
    margin: 0;
    padding: 0;
}
textarea{
    resize:none;
}
table {
    border-collapse: collapse;
    border-spacing: 0
}

fieldset,
img {
    border: 0
}

ol,
ul {
    list-style: none
}

caption,
th {
    text-align: left
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: 100%;
    font-weight: normal
}

q:before,
q:after {
    content: ''
}

abbr,
acronym {
    border: 0;
    font-variant: normal
}

sup {
    vertical-align: text-top
}

sub {
    vertical-align: text-bottom
}

input,
textarea,
select,
button
{
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit
}

input,
textarea,
select {
    *font-size: 100%
}

legend {
    color: #000
}

/*html5*/
article, aside, dialog, footer, header, section, footer, nav, figure, menu {
    display: block;
}

/*清浮动*/
.clearfix:after,.clearfix:after {
    content: '.';
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}

.clearfix {
    display: inline-block;
}

* html .clearfix {
    height: 1%;
}

.clearfix {
    display: block;
}



/*锚链接初始化*/
a {
    text-decoration: none;
    outline: none;
    color:#5d5d5d;
}

a:hover {
    text-decoration: none;
}

a:focus {
    outline: none;
    -moz-outline: none;
}

/*布局样式*/
.tc{
    text-align:center;
}
.fl {
    float: left;
    display: inline;
}

.fr {
    float: right;
    display: inline;
}
.pr {
    position: relative;
}

.pa {
    position: absolute;
}
.hide{
    display:none;
}
.show{
    display:block;
}

  tips弹框js:

  tips弹框js:

/**
 * javascript-tips
 * @author zyq
 * @version 1.0.1
 */
(function($) {
 $.tips = {
  tip : function(text, callback) {
   var me = this, layer = '<div id="J_mengban" style="z-index:5000;top:0;-webkit-transform: translateZ(0);opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);width:100%;height:100%;position:fixed;background-color:#000000;"></div>', options = '<div id="J_conform" style="width:360px;height:190px;position:fixed;z-index:200001; border: 1px solid #00b1bb; background-color:#ffffff;margin:auto;left:0;right:0;top:200px; border-radius: 5px;"><div style="height: 14px ;background-color: #00b1bb;margin-bottom: 30px;"></div><div style="color:#2b2e30;width: 300px;height: 50px;margin:80px auto;text-align: center;font-size:16px;padding-bottom: 10px;">'
     .concat(text, "</div></div>");
   me.cancel();
   $("body").append(layer);
   $("body").append(options);
   if (callback) {
    window.setTimeout(function() {
     callback(true);
    }, 1000);
   }
  },
  alert : function(text, callback) {
   var me = this, layer = '<div id="J_mengban" style="top:0;z-index: 5000;-webkit-transform: translateZ(0);opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);width: 100%;height: 100%;position: fixed;background-color: #000000;"></div>', options = '<div id="J_alert" style="width:360px;height: 190px;position: fixed;z-index: 200001; border: 1px solid #00b1bb;background-color: #ffffff;margin: auto;left:48%;top:45%;margin-top:-100px;margin-left:-150px;border-radius: 5px;"><div style="height: 14px ;background-color: #00b1bb;margin-bottom:35px;border-top-left-radius: 5px; border-top-right-radius: 5px;"></div><div style="width:300px;color:#2b2e30;height: auto;min-height:50px;margin:0 auto;text-align: center;line-height:25px;font-size:16px;padding-bottom:10px;">'
     .concat(
       text,
       '</div><div id="J_alert_ok" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff;margin-top:10px;bottom: 10px;margin: auto;left:0;right: 0;  width: 55%;height: 40px;background-color: #00b1bb;text-align: center;line-height: 40px;font-size:16px;">确定</div></div>');
   me.cancel();
   $("body").append(layer);
   $("body").append(options);
   $("#J_alert_ok").on("click", function() {
    me.cancel();
    if (callback) {
     callback();
    }
   });
  },
  conform : function(text, callback) {
   var me = this, layer = '<div id="J_mengban" style="z-index: 5000;-webkit-transform: translateZ(0);top:0;opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);width: 100%;height: 100%;position: fixed;background-color: #000000;"></div>', options = '<div id="J_conform" style="width:360px;height: 190px;position: fixed;z-index: 200001; border: 1px solid #00b1bb;background-color: #ffffff;margin: auto;left:0;right: 0;top:40%;margin-top:-100px;border-radius: 5px;"><div style="height: 14px ;background-color: #00b1bb;margin-bottom: 30px;-webkit-border-top-right-radius: 5px;-webkit-border-top-left-radius: 5px;"></div><div style="width:300px;color:#2b2e30;height: 50px;margin: auto;text-align: center;font-size:16px;padding-bottom: 10px;">'
     .concat(
       text,
       '</div><div id="J_alert_cancel" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff; position: absolute;bottom: 10px;left:20px;  width: 40%;height: 40px;background-color: #aaaaaa;text-align: center;line-height: 40px;font-size:16px;">取消</div><div id="J_alert_sure" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff; position: absolute;bottom: 10px;right:20px;  width: 40%;height: 40px;background-color: #00b1bb;text-align: center;line-height: 40px; font-size:16px;">确定</div></div>');
   me.cancel();
   $("body").append(layer);
   $("body").append(options);
   $("#J_alert_sure").on("click", function() {
    me.cancel();
    if (callback) {
     callback(true);
    }
   });
   $("#J_alert_cancel").on("click", function() {
    me.cancel();
    if (callback) {
     callback(false);
    }
   });
  },
  confirm : function(text, callback) {
   this.conform(text, callback);
  },
  toast : function(text, callback) {
   var me = this, content = '<div id="J_toast" style="position: fixed;z-index:5000;-webkit-transform: translateZ(0); text-align:center; left:0;right:0; bottom:100px; margin:auto; text-align: center;">'
     .concat(text, "</div>");
   me.cancel();
   $("body").append(content);
   window.setTimeout(hideToast, 2000);
   function hideToast() {
    me.cancel();
    if (callback) {
     callback(true);
    }
   }
  },
  prompt : function(callback) {
   var me = this, layer = '<div id="J_mengban" style="top:0;z-index: 5000;-webkit-transform: translateZ(0);opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);width: 100%;height: 100%;position: fixed;background-color: #000000;"> </div>', content = '<div id="J_alert" style="width:300px;height: 200px;position: fixed;z-index: 200001;background-color: #ffffff;margin: auto;left:0;right: 0;top:34%;"><div style="height: 14px ;background-color: #58cbc3;margin-bottom: 30px;"></div><textarea class="btn_textarea" id="J_prompt_content" style="width: 265px; margin-left: 15px; height: 90px; border-color:1px solid #e4e4e4;"></textarea><div style="color:#2b2e30;width: 300px;height: 50px;margin: auto;text-align: center;"></div><div id="J_alert_sure" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff; position: absolute;bottom: 10px;margin: auto;left:-100px;right: 0; float:left; width: 30%;height: 35px;background-color: #58cbc3;text-align: center;line-height: 35px;">确定</div><div id="J_alert_cancel" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff; position: absolute;bottom: 10px;margin: auto;left:110px;right: 0; float:left; width: 30%;height: 35px;background-color: #58cbc3;text-align: center;line-height: 35px;">取消</div></div>';
   me.cancel();
   $("body").append(layer);
   $("body").append(content);
   $("#J_alert_sure").on("click", function() {
    var txt = $("#J_prompt_content").val();
    if ($.trim(txt).length > 0) {
     me.cancel();
     if (callback) {
      callback(true, txt);
     }
    }
   });
   $("#J_alert_cancel").on("click", function() {
    me.cancel();
    if (callback) {
     callback(false, $("#J_prompt_content").val());
    }
   });
  },
  cancel : function() {
   $("#J_mengban,#J_conform,#J_alert,#J_toast").remove();
   return this;
  },
  close : function() {
   return this.cancel();
  }
 };
})($);
/**
 * javascript-tips
 * @author zyq
 * @version 1.0.1
 */
(function($) {
    $.tips = {
        tip : function(text, callback) {
            var me = this, layer = '<div id="J_mengban" style="z-index:5000;top:0;-webkit-transform: translateZ(0);opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);width:100%;height:100%;position:fixed;background-color:#000000;"></div>', options = '<div id="J_conform" style="width:360px;height:190px;position:fixed;z-index:200001; border: 1px solid #00b1bb; background-color:#ffffff;margin:auto;left:0;right:0;top:200px; border-radius: 5px;"><div style="height: 14px ;background-color: #00b1bb;margin-bottom: 30px;"></div><div style="color:#2b2e30;width: 300px;height: 50px;margin:80px auto;text-align: center;font-size:16px;padding-bottom: 10px;">'
                    .concat(text, "</div></div>");
            me.cancel();
            $("body").append(layer);
            $("body").append(options);
            if (callback) {
                window.setTimeout(function() {
                    callback(true);
                }, 1000);
            }
        },
        alert : function(text, callback) {
            var me = this, layer = '<div id="J_mengban" style="top:0;z-index: 5000;-webkit-transform: translateZ(0);opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);width: 100%;height: 100%;position: fixed;background-color: #000000;"></div>', options = '<div id="J_alert" style="width:360px;height: 190px;position: fixed;z-index: 200001; border: 1px solid #00b1bb;background-color: #ffffff;margin: auto;left:48%;top:45%;margin-top:-100px;margin-left:-150px;border-radius: 5px;"><div style="height: 14px ;background-color: #00b1bb;margin-bottom:35px;border-top-left-radius: 5px; border-top-right-radius: 5px;"></div><div style="width:300px;color:#2b2e30;height: auto;min-height:50px;margin:0 auto;text-align: center;line-height:25px;font-size:16px;padding-bottom:10px;">'
                    .concat(
                            text,
                            '</div><div id="J_alert_ok" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff;margin-top:10px;bottom: 10px;margin: auto;left:0;right: 0;  width: 55%;height: 40px;background-color: #00b1bb;text-align: center;line-height: 40px;font-size:16px;">确定</div></div>');
            me.cancel();
            $("body").append(layer);
            $("body").append(options);
            $("#J_alert_ok").on("click", function() {
                me.cancel();
                if (callback) {
                    callback();
                }
            });
        },
        conform : function(text, callback) {
            var me = this, layer = '<div id="J_mengban" style="z-index: 5000;-webkit-transform: translateZ(0);top:0;opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);width: 100%;height: 100%;position: fixed;background-color: #000000;"></div>', options = '<div id="J_conform" style="width:360px;height: 190px;position: fixed;z-index: 200001; border: 1px solid #00b1bb;background-color: #ffffff;margin: auto;left:0;right: 0;top:40%;margin-top:-100px;border-radius: 5px;"><div style="height: 14px ;background-color: #00b1bb;margin-bottom: 30px;-webkit-border-top-right-radius: 5px;-webkit-border-top-left-radius: 5px;"></div><div style="width:300px;color:#2b2e30;height: 50px;margin: auto;text-align: center;font-size:16px;padding-bottom: 10px;">'
                    .concat(
                            text,
                            '</div><div id="J_alert_cancel" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff; position: absolute;bottom: 10px;left:20px;  width: 40%;height: 40px;background-color: #aaaaaa;text-align: center;line-height: 40px;font-size:16px;">取消</div><div id="J_alert_sure" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff; position: absolute;bottom: 10px;right:20px;  width: 40%;height: 40px;background-color: #00b1bb;text-align: center;line-height: 40px; font-size:16px;">确定</div></div>');
            me.cancel();
            $("body").append(layer);
            $("body").append(options);
            $("#J_alert_sure").on("click", function() {
                me.cancel();
                if (callback) {
                    callback(true);
                }
            });
            $("#J_alert_cancel").on("click", function() {
                me.cancel();
                if (callback) {
                    callback(false);
                }
            });
        },
        confirm : function(text, callback) {
            this.conform(text, callback);
        },
        toast : function(text, callback) {
            var me = this, content = '<div id="J_toast" style="position: fixed;z-index:5000;-webkit-transform: translateZ(0); text-align:center; left:0;right:0; bottom:100px; margin:auto; text-align: center;">'
                    .concat(text, "</div>");
            me.cancel();
            $("body").append(content);
            window.setTimeout(hideToast, 2000);
            function hideToast() {
                me.cancel();
                if (callback) {
                    callback(true);
                }
            }
        },
        prompt : function(callback) {
            var me = this, layer = '<div id="J_mengban" style="top:0;z-index: 5000;-webkit-transform: translateZ(0);opacity:0.5;-moz-opacity:0.5;filter:alpha(opacity=50);width: 100%;height: 100%;position: fixed;background-color: #000000;"> </div>', content = '<div id="J_alert" style="width:300px;height: 200px;position: fixed;z-index: 200001;background-color: #ffffff;margin: auto;left:0;right: 0;top:34%;"><div style="height: 14px ;background-color: #58cbc3;margin-bottom: 30px;"></div><textarea class="btn_textarea" id="J_prompt_content" style="width: 265px; margin-left: 15px; height: 90px; border-color:1px solid #e4e4e4;"></textarea><div style="color:#2b2e30;width: 300px;height: 50px;margin: auto;text-align: center;"></div><div id="J_alert_sure" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff; position: absolute;bottom: 10px;margin: auto;left:-100px;right: 0; float:left; width: 30%;height: 35px;background-color: #58cbc3;text-align: center;line-height: 35px;">确定</div><div id="J_alert_cancel" style="border-radius:4px;-webkit-border-radius: 4px;-moz-border-radius: 4px; cursor: pointer; color:#ffffff; position: absolute;bottom: 10px;margin: auto;left:110px;right: 0; float:left; width: 30%;height: 35px;background-color: #58cbc3;text-align: center;line-height: 35px;">取消</div></div>';
            me.cancel();
            $("body").append(layer);
            $("body").append(content);
            $("#J_alert_sure").on("click", function() {
                var txt = $("#J_prompt_content").val();
                if ($.trim(txt).length > 0) {
                    me.cancel();
                    if (callback) {
                        callback(true, txt);
                    }
                }
            });
            $("#J_alert_cancel").on("click", function() {
                me.cancel();
                if (callback) {
                    callback(false, $("#J_prompt_content").val());
                }
            });
        },
        cancel : function() {
            $("#J_mengban,#J_conform,#J_alert,#J_toast").remove();
            return this;
        },
        close : function() {
            return this.cancel();
        }
    };
})($);

  

  

代码所需图片:

代码所需图片:

澳门葡京 1

澳门葡京 2

 完结效益:

 完毕效益:

澳门葡京 3

澳门葡京 4

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

*
*
Website