(function($){ $(function(){ apiObj=[{'n':'简介','h':'intro'} ,{'n':'快速入门','h':'fastindoor'} ,{'n':'示例程序','h':'rightExamples'} ,{'n':'参考手册','h':'apiDoc'}] $.each(apiObj,function(index,obj){ $('
  • '+obj.n+'
  • ') .hover(function(){ $(this).toggleClass('menuItemMouseover') }) .click(function(){ var targetHtml=(index<4)?obj.h+'.html':"http://www.zjditu.cn/API/Demo/"+obj.h+'.htm'; if(index<4){ $('#api_desc').load(targetHtml) }else{ window.open(targetHtml) } $(this) .addClass('menuItemSelected') .siblings() .removeClass('menuItemSelected') }) .appendTo((index<4)?'#api-declare':'#api-instance') }) $('#api-declare') .children(':first-child').trigger('click') }) })(jQuery)