jqzscg.js
$(function () {
$('.tbody').on("click", ".delete", function () {
var target = $(event.target);
target.parents("ul").remove();
})
$('.checkedAll').click(function () {
if ($(this).is(':checked')) {
$('.checkedOne').prop("checked", true);
} else {
$('.checkedOne').prop("checked", false);
}
});
$('.tbody').on("click", ".checkedOne", function () {
let len = $('.checkedOne').length;
let length = $('.checkedOne:checked').length;
if (len == length) {
$(".checkedAll").prop("checked", true)
} else {
$(".checkedAll").prop("checked", false)
}
})
var _arr = []
var str = ""
$(".add").click(function () {
$('.addContent').css('display', 'block')
})
$(".submit").click(function () {
$('.addContent').css('display', 'none')
$('body').css('background', '#fff')
let text = $(`<ul class="listBody">
<li><input type="checkbox" class="checkedOne"></li>
<li>${$('.nameC').val()}</li>
<li>${$('.nameCC').val()}</li>
<li>2018-05-19 11:23:20</li>
<li></li>
<li>
<button class="edit">编辑</button>
<button class="delete">删除</button>
</li>
<div style="clear:both"></div>
</ul>`)
$('.tbody').append(text)
})
})
$('.tbody').on("click", ".edit", function () {
$('.addGContent').css("display", "block")
})
var _this = null
$(document).on("click", ".edit", function () {
var _arr = []
_this = $(this).parents("ul")
$(this).parents("ul").find("li:not(:last)").each(function () {
_arr.push($(this).text())
})
$("#addGForm").find("input").each(function (i) {
$(this).val(_arr[i + 1])
})
})
$(document).on("click", ".submitG", function () {
$('.addGContent').css("display", "none")
var _arr = []
$("#addGForm").find("input").each(function () {
_arr.push($(this).val())
})
_this.find("li:not(:last)").each(function (i) {
$(this).text(_arr[i - 1])
})
})
$(".search").click(function () {
var Os1 = $(".s1").val()
var Os2 = $(".s2").val()
if (Os1.length == 0) {
alert("请输入")
} else if ($(".tbody ul:contains('" + Os1 + "')").length == 0) {
alert("无数据")
} else {
$(".tbody ul").hide()
$(".tbody ul:contains('" + Os1 + "')").show()
}
})
$('.menu').click(function () {
$(this).find('.menulist').slideToggle()
$(this).find('.menulist').parent().siblings('.menu').children('.menulist').slideUp(300)
// $('.shangxia').attr('src', "./下.png");
})
$('.admin').hover(function () {
$(".login").slideDown(400);
}, function () {
$(".login").slideUp(400);
})
var isShow = true;
$('.zk').click(function () {
if (isShow) {
$('.zk').attr('src', "./下载 (3).png");
$('aside').animate({
width: 64
}, 200)
$('span').fadeOut(250)
$('aside>ul>li>ul>li').css('display', 'none')
$('.shangxia').css('display', 'none')
$('aside>ul>li').addClass("focus").css("pointer-events", "none");
} else {
$('.zk').attr('src', "./下载 (2).png");
$('aside').animate({
width: 240
}, 200)
$('span').fadeIn(250)
$('aside>ul>li>ul>li').css('display', 'block')
$('.shangxia').css('display', 'inline-block')
$('aside>ul>li').addClass("focus").css("pointer-events", "auto");
// $('aside>ul>li').css('display','block')
}
isShow = !isShow
})
$('.menu').click(function(e){
if(isShow){
$(e.target).find('.shangxia').attr('src', "./下.png");
}else{
$(e.target).find('.shangxia').attr('src', "./上.png");
}
isShow = !isShow
})
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交