js 基础代码
此文件会随着时间不断更新
$(document).ready(function() {
$(".drop-down>li").click(function() {
var sub = $(this).children(".sub");
sub.slideDown(400);
var siblings = $(this).siblings().children(".sub");
siblings.slideUp(400);
$(this).children("span").children("i").removeClass("fa fa-angle-double-left");
$(this).children("span").children("i").addClass("fa fa-angle-double-down");
$(this).siblings().children("span").children("i").removeClass("fa fa-angle-double-down");
$(this).siblings().children("span").children("i").addClass("fa fa-angle-double-left");
});
});
$(document).ready(function() {
$(".card-drop-down>li").click(function() {
var sub = $(this).children(".card-sub");
sub.slideToggle(400);
});
});
####################################################################
$(document).ready(function() {
$(".list-group-item").eq(0).addClass("active");
$(".list-group-item").eq(0).siblings().removeClass("active");
$(".list-group-item").click(function index() {
$(this).attr({
"class": "list-group-item list-group-item-action active"
});
$(this).siblings().attr({
"class": "list-group-item list-group-item-action"
});
});
});
$("#ex").click(function() {
$("input[type='hidden']").attr('value', "value");
});
function form_post_add() {
var testform = document.getElementById("add");
testform.action = "add";
testform.name = "age";
testform.name = "hoppy";
testform.method = "post";
testform.submit();
}
function form_get_delect() {
var r = window.confirm("是否要删除该用户!");
if(r) {
var testform = document.getElementById("delect");
testform.action = "delect";
testform.name = "id";
testform.method = "get";
testform.submit();
}
}
function form_post_delect(yId) {
var r = window.confirm("是否要删除该用户!");
if(r) {
var testform = document.getElementById("DELECT_method");
testform.action = "list/" + yId;
testform.name = "_method";
testform.method = "get";
testform.submit();
}
}
function form_post_update() {
var testform = document.getElementById("PUT_method");
testform.action = "add/";
testform.name = "age";
testform.name = "hoppy";
testform.method = "post";
testform.submit();
}
function form_file_upload() {
var r = window.confirm("此上传不会删除原来数据库的所有数据!确定上传???");
if(r) {
var testform = document.getElementById("file_upload");
testform.accept = "application/msexcel";
testform.action = "uploadFile";
testform.name = "file";
testform.enctype = "multipart/form-data";
testform.method = "post";
testform.submit();
}
}
function form_file_uploadAll() {
var r = window.confirm("此上传会删除原来数据库的所有数据!确定上传???");
if(r) {
var testform = document.getElementById("file_uploadAll");
testform.accept = "application/msexcel";
testform.action = "uploadFileAll";
testform.name = "file";
testform.enctype = "multipart/form-data";
testform.method = "post";
testform.submit();
}
}