You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

273 lines
8.4 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

$(document).ready(function () {
//登录-输入框 ==========================
$(".login-from .input input").focus(function() {
$(this).parent().addClass("hover");
});
$(".login-from .input input").blur(function() {
$(this).parent().removeClass("hover");
});
//表单验证信息的消失下拉框的消失语句加在select.js里了 ==========================
$(".tips-text").each(function(i) {
$(this).css("z-index",50-i);
});
$(".tips-text, .pst-rela input, .pst-rela textarea").on("click",function() {
$(this).parents(".pst-rela").find(".tips-text").hide();
});
////顶部帐户信息 ==========================
$(".user-name").mouseover(function () {
$(".personal").show();
$(".top-user").mouseover(function () {
$(".personal").show();
});
});
$(".top-user").mouseleave(function () {
$(".top-user").unbind("mouseover");
$(".personal").hide();
});
//表格 table ==========================
$(".tableline tr").each(function() {
$(this).find("th:first").css("border-left","0");
$(this).find("td:first").css("border-left","0");
$(this).find("th:last").css("border-right","0");
$(this).find("td:last").css("border-right","0");
});
//理财实训-潜在客户-新增客户 ==========================
$(".sib-list").each(function() {
$(".add-sib").each(function() {
$(this).click(function() {
$(this).prev(".sib-item").clone(true).insertAfter($(this).prev());
});
});
$(".close").click(function() {
$(this).parent(".sib-item").remove();
});
});
$(".js_addItem").each(function() {
$(this).click(function() {
$(this).prev(".js_itembox").clone(true).insertAfter($(this).prev());
});
});
$(".js_remove").each(function() {
$(this).click(function() {
$(this).parents(".js_itembox").remove();
})
});
//表单
$(".item .fif-form").each(function() {
$(this).find(".fif-box.w100:last").css("margin-bottom","0");
});
$(".selected span i").each(function() {
$(this).click(function() {
$(this).parent("span").remove();
});
});
//子系统
$(".subsystem .item .fif-form").css({"margin-left":$(".subsystem .item .item-left").width(),"float":"none"});
//题型切换
$(".question-types span").click(function() {
$(this).addClass("active").siblings().removeClass("active");
var indext =$(".question-types span").index(this);
$(".selected-topic").eq(indext).show().siblings().hide();
});
//左右点击按钮滚动
$(".caption-list-title").each(function() {
var Wid=51, //单个的宽度
n =1, //一次翻动的个数
$Ul = $(this).children(".caption-switch").children(".caption-switch-con"),
$Pre = $(this).find(".prev"),
$Nex = $(this).find(".next"),
Len = $Ul.children("span").length,
Left = parseInt($Ul.css("left"));
$Pre.click(function() {
Left=parseInt(Left)+n*Wid;
if(Left>0){
Left=0;
}
$Ul.stop().animate({left:Left});
});
$Nex.click(function() {
Left-=n*Wid;//n为一次滚动的个数
if(Left<-Wid*(Len-4)){//4为显示的个数
Left=-Wid*(Len-4);
};
$Ul.stop().animate({left:Left});
});
$(".caption-switch-con span").click(function() {
$(this).addClass("on").siblings().removeClass("on");
});
});
//左右点击按钮滚动-题型
$(".question-types").each(function() {
var Wid=73, //单个的宽度
n =1, //一次翻动的个数
$Ul = $(this).children(".caption-switch").children(".question-types-box"),
$Pre = $(this).find(".prev"),
$Nex = $(this).find(".next"),
Len = $Ul.children("span").length,
Left = parseInt($Ul.css("left"));
$Pre.click(function() {
Left=parseInt(Left)+n*Wid;
if(Left>0){
Left=0;
}
$Ul.stop().animate({left:Left});
});
$Nex.click(function() {
Left-=n*Wid;//n为一次滚动的个数
if(Left<-Wid*(Len-10)){//4为显示的个数
Left=-Wid*(Len-10);
};
$Ul.stop().animate({left:Left});
});
$(".question-types-box span").click(function() {
//tab切换
var idx=$(".question-types-box span").index(this);
$(this).addClass("active").siblings().removeClass("active");
$(".serial-number .number").hide().eq(idx).show();
});
});
//弹窗 ==============================
$(".popup").each(function() {
var height = $(this).height();
$(this).css("margin-top",-height/2);
});
$(".JS-addInfo").click(function(){
$("#popAddInfo").show();
});
$(".JS-registrations").click(function(){
$("#popRegistrations").show();
});
$(".JS-fundType").click(function(){
$("#popFundType").show();
});
$(".JS-selectCase").click(function(){
$("#popSelectCase").show();
});
$(".JS-assessmentSettings").click(function(){
$("#popAssessmentSettings").show();
});
$(".JS-trainingClass").click(function(){
$("#popTrainingClass").show();
});
$(".JS-chapterManage").click(function(){
$("#popChapterManage").show();
});
$(".JS-viewMark").click(function(){
$("#popViewMark").show();
});
$(".JS-viewChart").click(function(){
$("#popViewChart").show();
});
$(".JS-viewBer").click(function(){
$("#popViewBer").show();
});
$(".JS-scoreReport").click(function(){
$("#popScoreReport").show();
});
$(".JS-testSet").click(function(){
$("#popTestSet").show();
});
$(".JS-personalCenter").click(function(){
$("#popPersonalCenter").show();
});
$(".JS-changePassword").click(function(){
$("#popChangePassword").show();
});
$(".JS-questionBankList").click(function(){
$("#popQuestionBankList").show();
});
$(".JS-questionBankSelect").click(function(){
$("#popQuestionBankSelect").show();
});
$(".JS-questionBankAdd").click(function(){
$("#popQuestionBankAdd").show();
});
$(".JS-questionBankAdd2").click(function(){
$("#popQuestionBankAdd2").show();
});
$(".JS-questionBankAdd3").click(function(){
$("#popQuestionBankAdd3").show();
});
$(".JS-questionBankAdd5").click(function(){
$("#popQuestionBankAdd5").show();
});
$(".JS-delete").click(function(){
$("#popDelete").show();
});
$(".JS-confirm").click(function(){
$("#popConfirm").show();
});
$(".JS-enquire").click(function(){
$("#popEnquire").show();
});
$(".popup .close,.pop-button .btn-close").click(function(){
$(this).parents(".popup").hide();
var len = $(".windowBg:visible").length;
$(".windowBg").eq(len-1).remove();
});
$(".JS-popBtn").click(function() {
$("body").append('<div class="windowBg"></div>');
for(var i=0; i < $(".popup:visible").length; i++){
$(".popup:visible")[i].style.zIndex = 222+i*10;
$(".windowBg")[i].style.zIndex = 221+i*9;
};
});
});
$(document).ready(function() {
//浮层
$(".JS-fixCase").click(function() {
$(".fix-case").toggle();
$(".fix-lore").hide();
$(".fix-small").css({"margin-top":"0","margin-left":"-505px"});
});
$(".JS-fixLore").click(function() {
$(".fix-lore").toggle();
$(".fix-case").hide();
$(".fix-small").css({"margin-top":"0","margin-left":"-505px"});
});
$(document).on("click", "#closeExaBtn", function () {
// console.log("close");
});
$("#closeExaBtn").click(function () {
//console.log("close");
});
$(".fix-item-box .close").click(function () {
// console.log("close");
$(this).parent().hide();
$(".windowBg").remove();
});
var left, top, $this;
$(document).delegate('.drag_div', 'mousedown', function (e) {
left = e.clientX, top = e.clientY, $this = $(this).css('cursor', 'move');
this.setCapture ? (
this.setCapture(),
this.onmousemove = function (ev) { mouseMove(ev || event); },
this.onmouseup = mouseUp
) : $(document).bind("mousemove", mouseMove).bind("mouseup", mouseUp);
});
function mouseMove(e) {
var target = $this.parents('.fix-small');
var l = Math.max((e.clientX - left + Number(target.css('margin-left').replace(/px$/, '')) || 0), -target.position().left);
var t = Math.max((e.clientY - top + Number(target.css('margin-top').replace(/px$/, '')) || 0), -target.position().top);
l = Math.min(l, $(document).width() - target.width() - target.position().left);
t = Math.min(t, $(document).height() - target.height() - target.position().top);
left = e.clientX;
top = e.clientY;
target.css({ 'margin-left': l, 'margin-top': t });
}
function mouseUp(e) {
var el = $this.get(0);
el.releaseCapture ?
(
el.releaseCapture(),
el.onmousemove = el.onmouseup = null
) : $(document).unbind("mousemove", mouseMove).unbind("mouseup", mouseUp);
}
});