chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
$(document).ready(function () {     
    $(".cp_ti_canj").hover(function(){
        $(this).css("background-color","#f0f0f0");
    },function(){
        $(this).css("background-color","");
    });
    
    /*点击选项,更改class*/
    $(".cp_ti_canj").click(function(){ 
        $(this).parent().children().removeClass("cp_ti_canj01");/*同组选项的背景色恢复默认*/
        $(this).parent().children().children("input[type='radio']").removeAttr("checked");
        if($(this).children("input[type='radio']").attr("checked") == undefined ){
            $(this).children("input[type='radio']").attr("checked","checked")
            $(this).addClass("cp_ti_canj01");
        }
    });  
    /*检测是否全部选择*/
    $("#submitexam").click(function(){
        var error=0;    
        $(".cp_timu_topic01>.cp_timu_topic").each(function(){
            var tid=$(this).attr("tid"); 
            var val=$("input:radio[name='q"+tid+"']:checked").val();
            if(isNaN(val)){ 
                error+=1;
                var top=parseInt($(".eva"+tid).offset().top)-parseInt(30); 
                layer.msg("必须全部答完才能交卷!",2,8,function(){$("html, body").animate({scrollTop:top});return false;});return false;
            } 
        });
        if(error=='0'){
            setTimeout(function(){$('#gradeform').submit()},0);
        }
    }); 
    window.topBigDiv = $("div.cp_text_top");
    var topBottonLi = $("#top_small").children("ul").children("li");
    window.targetIndex = 0;
    window.timer;
    window.intervalMS = 3000; 
    $("#cp_top_div,#top_small").mouseover(function(){
        clearInterval(timer);
    });
    $("#cp_top_div,#top_small").mouseout(function(){
        timer = setInterval("huandeng()", intervalMS);
    });
    timer = setInterval("huandeng()", intervalMS);
 
    /*鼠标移动选择大图片*/
    topBottonLi.mouseover(function () {
        targetIndex = $(this).index();
        topBigDiv.each(function (index, domEle) {
            if (Number(targetIndex) == Number(index)) {
                $(domEle).show();
            } else {
                $(domEle).hide();
            }
        });
    });
});
function huandeng() {
    topBigDiv.each(function (index, domEle) {
        if (Number(targetIndex % 4) == Number(index)) {
            $(domEle).show();
        } else {
            $(domEle).hide();
        }
    });
    targetIndex++;
function gradely(){
    noplaceholder('grademessage');
    var msg=$("#grademessage").val();
    if(msg==''){
        layer.msg("请填写留言内容!",2,8);return false;
    }
}