(function($) { $.fn.extend({ IMGDEMO:function(opt) { var opt = arguments[0] ? arguments[0] :false; var $button = $(this).children("li") ; //容器; var $sec = 3000 ; //自动播放默认时间; var $min = $button.last().width() ; //最小宽度; var $max = $button.first().width() ; //最大宽度; var $index = 1 ; //轮播开始索引号; $default = { //默认参数; speed : opt.speed ? opt.speed : "slow" , by : opt.by ? opt.by : "click" , auto : opt.auto ? opt.auto : false , sec : opt.sec ? opt.sec < 1000 ? 1000 : opt.sec : $sec , maxWidth: $max , minWidth: $min , index : $index }; $button.bind($default.by, this.run).autoPlay(); //绑定事件; }, run:function() { //运行方法; var $obj = $(this); if ($obj.width() == $default.minWidth) { var timeDo = window.setTimeout(function() { $default.index = $obj.index(); $obj.anim(); }, 100); $obj.mouseout(function() { window.clearTimeout(timeDo); }); } }, autoDo:function() { //播放方法; var $len = $(this).length - 1; var $this = $(this); timeL = window.setInterval(function() { $this.eq($default.index).anim(); $default.index < $len ? $default.index++ :$default.index = 0; }, $default.sec); }, anim:function() { //动画方法; var $fx = function() { $(this).siblings("li").animate({ width : $default.minWidth, opacity : 1 }, $default.speed).css("cursor", "pointer"); $(this).animate({ width : $default.maxWidth, opacity : 1 }, $default.speed).css("cursor", "default"); $(this).siblings("li").children("div").fadeOut(); $(this).children("div").fadeTo($default.speed,0.7); $(this).dequeue(); }; $(this).queue($fx); } }); })(jQuery); $(function(){ $("#tab1 .hd li").each(function(index){ $(this).mouseover(function(){ $(this).addClass("on") .siblings().removeClass("on"); $("#tab1 .bd ul:eq("+ index +")").show() .siblings().hide(); }) }); // $("#tab2 .hd li").each(function(index){ // $(this).mouseover(function(){ // $(this).addClass("on") // .siblings().removeClass("on"); // $("#tab2 .bd #bd"+ index).show() // .siblings().hide(); // var a = index+1; // var myChart = echarts.init(document.getElementById('mainTjt'+a),'macarons');myChart.setOption({animation:true,grid:{x:60,x2:30,y:20,y2:60,borderWidth:0,height:130},tooltip:{trigger:'item'},legend:{data:['本月产量(万吨)','本月同比(% )'],x:'center',y:'180'},xAxis:[{type:'category',data:['2014-06','2014-07','2014-08','2014-09','2014-10','2014-11']}],yAxis:[{type:'value'},{type:'value'}],series:[{name:'本月产量(万吨)',type:'bar',data:[29800.0,30100.0,30200.0,29200.0,29100.0,33000.0]},{name:'本月同比(% )',type:'line',yAxisIndex: 1,data:[-2.0,-1.6,-0.98,-7.0,-8.5,-4.9]}]}); // myChart.on(echarts.config.EVENT.CLICK , function(param){ // indexFormSub("",6,10); // }); // }) // }) }); function xz(){ alert("请在客户端下载!"); } function xz2(id,name){ var con = confirm("确定要进行下载吗?"); if(con==true){ document.createExl.action=path+"/website/word/download.jsp?id="+id+"&name="+name+"&encodename="+encodeURI(encodeURI(name)); document.createExl.method="POST"; document.createExl.submit(); $.ajax({ type : 'POST', url : path + "/userlog/userJspLog.action", data : { 'shjspLog.url' : "/website/word/download.jsp?id="+id, 'shjspLog.content' : "资讯中心--期刊下载--下载" }, success : function(msg) { } }); } } function xz3(id,name){ var con = confirm("确定要进行下载吗?"); if(con==true){ document.createExl.action=path+"/website/word/download.jsp?id="+id+"&name="+name+"&encodename="+encodeURI(encodeURI(name)); document.createExl.method="POST"; document.createExl.submit(); $.ajax({ type : 'POST', url : path + "/userlog/userJspLog.action", data : { 'shjspLog.url' : "/website/word/download.jsp?id="+id, 'shjspLog.content' : "研究中心--研究报告--下载" }, success : function(msg) { } }); } } $(function(){ $("#tab2 .hd li").each(function(index){ $(this).mouseover(function(){ $(this).addClass("on") .siblings().removeClass("on"); $("#tab2 .bd ul:eq("+ index +")").show() .siblings().hide(); }) }) $("#tab3 .hd li").each(function(index){ $(this).mouseover(function(){ $(this).addClass("on") .siblings().removeClass("on"); $("#tab3 .bd ul:eq("+ index +")").show() .siblings().hide(); }) }) $("#tab4 .hd li").each(function(index){ $(this).mouseover(function(){ $(this).addClass("on") .siblings().removeClass("on"); $("#tab4 .bd ul:eq("+ index +")").show() .siblings().hide(); }) }) }) function get(name,cursel,n){ for(i=1;i<=n;i++){ var menu=document.getElementById(name+i); var con=document.getElementById(name+"-"+i); var por=document.getElementById(name+"_"+i); menu.className=i==cursel?"jb":"jbs"; con.style.display=i==cursel?"block":"none"; por.style.display=i==cursel?"block":"none"; } } function set(name,cursel,n){ for(i=1;i<=n;i++){ var menu=document.getElementById(name+i); var con=document.getElementById(name+"-"+i); var mor=document.getElementById(name+"_"+i); menu.className=i==cursel?"tabs_act":"tabs"; con.style.display=i==cursel?"block":"none"; mor.style.display=i==cursel?"block":"none"; } } function let(name,cursel,n){ for(i=1;i<=n;i++){ var menu=document.getElementById(name+i); var con=document.getElementById(name+"_"+i); menu.className=i==cursel?"fl":"fls"; con.style.display=i==cursel?"block":"none"; } } function bet(name,cursel,n){ for(i=1;i<=n;i++){ var menu=document.getElementById(name+i); menu.className=i==cursel?"navc":"navcs"; } }