Tạo nút lên, xuống, cuộn trang cho blog
Thứ Năm, 23 tháng 4, 2015
Cách thứ nhất:
<!-- BAT DAU LEN XUONG --> <style type='text/css'> #backscroll { width:30px; line-height:50px; position:fixed; right:5px; top:350px; } </style> <script language='javascript'> /* <![CDATA[ */ suspendcode="<div id='backscroll'><a onclick='javascript:amutop();return false;' href='#' title='LÊN ĐẦU'><img border=0 src=\"https://lh5.googleusercontent.com/-ObCGpcQDQDk/T35aQPPWQMI/AAAAAAAAAPA/8iDyiJ07n3Y/s48/top.gif\" width=\"30\"></a><br><a onclick='javascript:history.back();return false;' href='#' title='TRỞ LẠI TRANG VỪA XEM'><img border=0 src=\"https://lh4.googleusercontent.com/-HQASFJRYdd0/T35aO4vWfrI/AAAAAAAAAOo/WtpQMguYPLs/s48/back.gif\" width=\"30\"></a><br><a onclick='javascript:sc();return false;' href='#' title='DỪNG CUỘN'><img border=0 src=\"https://lh5.googleusercontent.com/-mZIfXp3qmSM/T35aP6jrhtI/AAAAAAAAAO0/Dda_pbetGyE/s48/ting.gif\" width=\"30\"></a><br><a onclick='javascript:clearInterval(timer);initialize();return false;' href='#' title='TỰ ĐỘNG CUỘN'><img border=0 src=\"https://lh4.googleusercontent.com/-HW6-lwAajuU/T35aO55KD8I/AAAAAAAAAOs/uWG9m072otc/s48/gun.gif\" width=\"30\"></a><br><a onclick='javascript:amubutton();return false;' href='#' title='XUỐNG CHÂN'><img border=0 src=\"https://lh4.googleusercontent.com/-i00crAzVJK0/T35aO5nmNdI/AAAAAAAAAOw/t0BCAeUQZbY/s48/end.gif\" width=\"30\"></a></div>" document.write(suspendcode);var currentpos,timer;function initialize(){timer=setInterval("scrollwindow ()",30)}function sc(){clearInterval(timer)}function scrollwindow(){currentpos=document.documentElement.scrollTop||document.body.scrollTop;window.scrollTo(0,++currentpos)}function amutop(){window.scrollTo(0,0);clearInterval(timer)}function amubutton(){window.scrollTo(0,8E4);clearInterval(timer)};/* ]]> */</script> <!-- KET THUC LEN XUONG -->
- Bấm "Lưu mẫu" và trở lại trang chủ xem kết quả.
Cách thứ hai:
- Vào "Bố cục" thêm một tiện ích HTML/Javascript ở một vị trí bất kỳ, để trống tiêu đề và dán toàn bộ đoạn code ở khung trên vào phần nội dung.
Nguồn: St
Bài liên quan

Home










Comments[ 0 ]
Đăng nhận xét