/** * Created by dn on 2016/1/18. */ $(function () { //站内站外显示隐藏 $('.select-change').click(function(){ var doType = $(this).text(); if(doType == '站外'){ $('#show_category_name').text('站外'); $('#option_category_name').text('站内'); $('#sForm').attr('action','https://www.baidu.com/s').attr('method','get'); }else { $('#show_category_name').text('站内'); $('#option_category_name').text('站外'); $('#sForm').attr('action', 'http://211.153.32.22:8080/plugin/search_list.jsp').attr('method', 'post'); } }); $('.select').click(function () { $(this).find('.search_all_category').stop().slideToggle(); }); //月份左右滚动 var myDate = new Date(); var month = myDate.getMonth(); //active var m = "#m" + (month + 1); $(m).addClass("active"); if (month < 6) { $('#s1').show(); $('#s2').hide(); $('#zt').val('1'); } else { $('#s2').show(); $('#s1').hide(); $('#zt').val('2'); } $("#l").on("click", function () { var zt = $("#zt").val(); if (zt == 1) { return false; } else { $('#s1').show(); $('#s2').hide(); $("#zt").val('1') } }); $("#r").on("click", function () { var zt = $("#zt").val(); if (zt == 2) { return false; } else { $('#s2').show(); $('#s1').hide(); $("#zt").val('2') } }); //信息公开展开收缩效果 $(".xxgk_box .xxgk_arrow_close").click(function () { $(this).hide().parent().parent().parent().find(".xxgk_arrow_open").show(); $(this).parent().parent().parent().find(".xxgk_bar1").hide().next(".xxgk_bar2").show(); }) $(".xxgk_box .xxgk_arrow_open").click(function () { $(this).hide().parent().parent().parent().find(".xxgk_arrow_close").show(); $(this).parent().parent().parent().find(".xxgk_bar2").hide().prev(".xxgk_bar1").show(); }) //办事服务展开收缩效果 $(".business_sever_box .b_arrow_close").click(function () { $(this).hide().next(".b_arrow_open ").show(); $(this).parents(".business_sever_box").find(".business_box").show(); }) $(".business_sever_box .b_arrow_open").click(function () { $(this).hide().prev(".b_arrow_close ").show(); $(this).parents(".business_sever_box").find(".business_box").hide(); }) $(".business_sever_box .b_arrow_like").click(function () { // $(this).hide().next(".b_arrow_open ").show(); $(this).parent().prev(".title").find(".b_arrow_close ").hide().next(".b_arrow_open ").show(); $(this).parents(".business_sever_box").find(".business_box").show(); }) //政民互动展开收缩效果 $(".interact .b_arrow_close").click(function () { $(this).hide().next(".b_arrow_open ").show(); $(this).parents(".interact").find(".interBox1").hide().next(".interBox2").show(); }) $(".interact .b_arrow_open").click(function () { $(this).hide().prev(".b_arrow_close ").show(); $(this).parents(".interact").find(".interBox2").hide().prev(".interBox1").show(); }) //教育资源展开收缩效果 $(".edu_resources .b_arrow_close").click(function(){ $(this).hide().next(".b_arrow_open ").show(); $(this).parents(".edu_resources").find(".edu_res_box1").hide().next(".edu_res_box2").show(); }); $(".edu_resources .b_arrow_open").click(function(){ $(this).hide().prev(".b_arrow_close ").show(); $(this).parents(".edu_resources").find(".edu_res_box2").hide().prev(".edu_res_box1").show(); }); $(".edu_resources .b_arrow_like").click(function(){ $(this).parent().prev(".title").find(".b_arrow_close ").hide().next(".b_arrow_open ").show(); $(this).parents(".edu_resources").find(".edu_res_box1").hide().next(".edu_res_box2").show(); }); //教育资源鼠标滑动效果 $(".edu_res_box1 li").each(function(e,ele){ $(this).find('img').attr('src','images/'+(e+1)+'_0'+(1)+'.png'); var oldColor=$(this).find('a').css('color'); $(this).hover(function(){ $(this).find('a').css('color',"#2d2d2d"); $(this).find('img').attr('src','images/'+(e+1)+'_0'+(1+2)+'.png'); },function(){ $(this).find('a').css('color',oldColor); $(this).find('img').attr('src','images/'+(e+1)+'_0'+(1)+'.png'); }); }); //站点导航展开收缩效果 $(".site_nav .navsit_close").click(function () { $(this).hide().parent().parent().parent().find(".navsit_open").show(); $(this).parent().parent().parent().find(".site_bar1").hide().next(".site_bar2").show(); }); $(".site_nav .navsit_open").click(function () { $(this).hide().parent().parent().parent().parent().find(".navsit_close").show(); $(this).parent().parent().parent().parent().find(".site_bar2").hide().prev(".site_bar1").show(); }); //政民互动左侧微信展开lhy //向上滚动的插件 ;(function ($, window, document, undfined) { $.fn.extend({ myScroll: function (options) { var Default = { speed: 40, rowHeight: 20, lineHeight: 20, Timeout: false, delay_time: 3000 }; var sttings = $.extend({}, Default, options), inted = []; this.find('ul li').css({ 'height': sttings.rowHeight, 'lineHeight': sttings.lineHeight }); return this.each(function (i, elm) { var This = $(this), speed = sttings.speed, _height = sttings.rowHeight; function my_scroll(obj, step) { var _tab = false; obj.find('ul').animate({ marginTop: '-=1' }, 0, function () { var mt = Math.abs(parseInt($(this).css('marginTop'))); if (mt >= step) { $(this).find('li:eq(0)').appendTo($(this)); $(this).css('marginTop', '0'); if (parseInt($(this).css('marginTop')) == 0 && sttings.Timeout) { clearInterval(This.timer); This.timer2 = setTimeout(function () { setTimer(); }, sttings.delay_time) } } }); } function setTimer() { clearInterval(This.timer); This.timer = setInterval(function () { my_scroll(This, _height); }, speed); } setTimer(); This.hover( function () { clearTimeout(This.timer2); clearInterval(This.timer); }, function () { setTimer(); } ); }); } }); }(jQuery, window, document)) })