

jQuery(document).ready(function($){  //注意要用这个把jQuery代码都包裹起来，不然里面的可都是无效的

 //这是siderbar的
$("#sidebar ul li a").hover(function(){
		$(this).stop().animate({marginLeft:"22px"}, 250,"easeOutBounce");}
	,function(){
		$(this).stop().animate({marginLeft:"10px"}, 150,"easeOutBounce");
});

$("#sidebar ul li span a").hover(function(){
		$(this).stop().animate({marginLeft:"10px"}, 0,"easeOutBounce");}
	,function(){
		$(this).stop().animate({marginLeft:"10px"}, 0,"easeOutBounce");
});

$("#sidebar span a").hover(function(){
		$(this).stop().animate({marginLeft:"10px"}, 0,"easeOutBounce");}
	,function(){
		$(this).stop().animate({marginLeft:"10px"}, 0,"easeOutBounce");
});


$("#sidebar ul li ul li.sidecom2 a").hover(function(){
		$(this).stop().animate({marginLeft:"12px"}, 250,"easeOutBounce");}
	,function(){
		$(this).stop().animate({marginLeft:"0px"}, 150,"easeOutBounce");
});

//nav开始
$("#home a").hover(function (){
	$(this).animate({marginTop:"10px"}, 350,"easeOutBounce");
	}
	,function () {
    $(this).animate({marginTop:"0px"}, 150,"easeOutBounce");
	});
	
	
$("#home a").hover(function (){
	$(this).animate({marginTop:"10px"}, 350,"easeOutBounce");
	}
	,function () {
    $(this).animate({marginTop:"0px"}, 150,"easeOutBounce");
});



$("#arc a").hover(function (){
	$(this).animate({marginTop:"10px"}, 350,"easeOutBounce");
	}
	,function () {
    $(this).animate({marginTop:"0px"}, 150,"easeOutBounce");
});

$("#tag a").hover(function (){
	$(this).animate({marginTop:"10px"}, 350,"easeOutBounce");
	}
	,function () {
    $(this).animate({marginTop:"0px"}, 150,"easeOutBounce");
});



$("#link a").hover(function (){
	$(this).animate({marginTop:"10px"}, 350,"easeOutBounce");
	}
	,function () {
    $(this).animate({marginTop:"0px"}, 150,"easeOutBounce");
});



$("#about a").hover(function (){
	$(this).animate({marginTop:"10px"}, 350,"easeOutBounce");
	}
	,function () {
    $(this).animate({marginTop:"0px"}, 150,"easeOutBounce");
});

  
	//nav结束
	
	
	
	//滑动控制
	$('#shang').click(function(){$('html,body').animate({scrollTop: '0px'}, 1800,"easeInOutCubic");}); 
	$('#comt').click(function(){$('html,body').animate({scrollTop:$('#comments').offset().top}, 1800,"easeInOutCubic");});
	$('#xia').click(function(){$('html,body').animate({scrollTop:$('#footer').offset().top}, 1800,"easeInOutCubic");});
			
		
				
					
	//广告
	
	
						
						
					$("#adbg").hover(
					
					function() {	
				　　// 鼠标悬停时候被触发的函数
				   $(this).animate({'left':'+=200px'},250,"easeInOutCubic");

				  }, 
				  function() {
				   // 鼠标移出时候被触发的函数 /*ijomyo*/
				   $(this).animate({'left':'-200px'},250,"easeInOutCubic");   });
				   
												
										
				
});	



jQuery(document).ready(function($) {

$body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body');// 这行是 Opera 的补丁, 少了它 Opera 是直接用跳的而且画面闪烁 by willin

$('#comments #top').click(function(){
	$body.animate({scrollTop: $('#header').offset().top}, 1800,"easeInOutCubic");
	return false;
});

});


//导航 滑动*/ 

jQuery(document).ready(function($){ 

if ($ != jQuery) {
    $ = jQuery.noConflict();
};
	$(window).scroll(function (){ //浏览器滚动条触发事件
		$("#shangxia").animate({top : $(window).scrollTop() + 300 + "px" },{queue:false,duration:500});
	    $("#adbg").animate({top : $(window).scrollTop() + 150 + "px" },{queue:false,duration:500});		
	});

});






if ($ != jQuery) {
    $ = jQuery.noConflict();
};

jQuery(document).ready(function($) {
$('#content a img').animate({"opacity": 1 });
$('#content a img').hover(function() {
$(this).stop().animate({ "opacity": .8 },250);
}, function() {
$(this).stop().animate({ "opacity": 1 },250);
});
});




    jQuery(document).ready(function($) {
    				//缩略图动画
                    $("#content .post .featured-thumbnail").hover(function(){ 
                                if(!$(this).is(":animated")){
                                $(this).animate({top:'-6px'},210).animate({top:'0px'},180)
                                .animate({top:'-3px'},150).animate({top:'0px'},130)
                                .animate({top:'-1px'},100).animate({top:'0px'},80);
                                }
                    });	
					
					 $(function() {
					//遍历图片；
					$('#content .post a img').each(function(i) {
					//如果存在 title 值，才执行下面代码；
					if (this.title) {
						//赋值获取 title 的值；
						var imgTitle = this.title;
						var x = 15;
						//鼠标滑过；标题为空值；在 body 中插入显示标题的容器，id 为 #tooltip；
						//定位 #tooltip 的显示位置并显示；
						$(this).mouseover(function(e) {
							this.title = '';
							$('body').append('<div id="tooltip">'+imgTitle+' (点击查看大图)</div>');
							$('#tooltip').css({'left': (e.pageX+x) + 'px', 'top': e.pageY + 'px'}).fadeTo('opacity', 0.9);
						})
						//鼠标滑出；标题 title 值恢复；移除鼠标滑过时添加的容器 #tooltip；
						.mouseout(function() {
							this.title = imgTitle;
							$('#tooltip').remove();
						})
						//设置标题容器跟随鼠标移动。
						.mousemove(function(e) {
							$('#tooltip').css({'left': (e.pageX+x) + 'px', 'top': e.pageY + 'px'});
						});
					}
					});
				});
				
//图片插件选择项目
					$("#content .post .fancyimg").fancybox({
					'overlayOpacity': 0.1,
				   	'transitionIn'	: 'elastic',
				   	'transitionOut'	: 'elastic',
					'padding'	: 5,
					'easingIn'      : 'easeOutBack',
        				'easingOut'     : 'easeInBack'
					}); 


					$("#content h2 a").hover(function(){ 
						if(!$(this).is(":animated")){
						$(this).animate({opacity:".6" },210).animate({opacity:"1"},180);
						}
					});

	     	 			$('#content h2 a').click(function(){
						$(this).text('页面开始载入……');
						$(this).animate({marginLeft:"12px"}, 250,"easeOutBounce");
					});
						  
    });
