Most of you have already known about how to add 'scroll to top' by adding simple '#top' to your links. لقد عرف بالفعل معظم لكم عن كيفية إضافة 'انتقل إلى أعلى' من خلال إضافة بسيطة '# الأعلى' لصلاتك. But, this one uses Jquery which makes it really smooth ( you really like it for sure). ولكن ، هذا واحد يستخدم مسج مما يجعله سلسا حقا (كنت حقا مثل ذلك بالتأكيد).
So, lets learn how to add it to your Blogger blog.. بذلك ، يتيح معرفة كيفية إضافته إلى بلوق مدون الخاص..
1. 1. Go to Layout » Edit html الذهاب إلى تخطيط »تحرير أتش تي أم أل
Find البحث
</body>
</body>
Add before أضف قبله<a href="#" id="backtotop">^ Scroll to Top</a>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'></script>
<script type='text/javascript'>
/*-----------------------
*Scroll to top
-----------------------*/
$(function(){$.fn.scrollToTop=function(){$(this).hide().removeAttr("href");if($(window).scrollTop()!="0"){$(this).fadeIn("slow")}var scrollDiv=$(this);$(window).scroll(function(){if($(window).scrollTop()=="0"){$(scrollDiv).fadeOut("slow")}else{$(scrollDiv).fadeIn("slow")}});$(this).click(function(){$("html, body").animate({scrollTop:0},"slow")})}});
$(function() {
$("#toTop").scrollToTop();
});
</script>
<a href="#" id="backtotop">^ Scroll to Top</a>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'></script>
<script type='text/javascript'>
/*-----------------------
*Scroll to top
-----------------------*/
$(function(){$.fn.scrollToTop=function(){$(this).hide().removeAttr("href");if($(window).scrollTop()!="0"){$(this).fadeIn("slow")}var scrollDiv=$(this);$(window).scroll(function(){if($(window).scrollTop()=="0"){$(scrollDiv).fadeOut("slow")}else{$(scrollDiv).fadeIn("slow")}});$(this).click(function(){$("html, body").animate({scrollTop:0},"slow")})}});
$(function() {
$("#toTop").scrollToTop();
});
</script>
2.. البحث عن هذا الكود
]]></b:skin>
]]></b:skin>
Add before أضف قبله مباشرة
3. Save the changes! حفظ التغييرات!#backtotop { width:100px;background:#F4FFBF;border:1px solid #ccc;text-align:center;padding:5px;position:fixed;bottom:10px;right:10px;cursor:pointer;color:#666;text-decoration:none; }
0 التعليقات: