Chào mừng quý vị đến với website Chinhphuc24h
Tạo nút xem code cho website
Code:
<link rel='stylesheet' href='http://2traitim.totalh.net/css/xemcode1.css' />
<link rel='stylesheet' href='http://2traitim.totalh.net/css/xemcode2.css' />
<style>
#source-code { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.8); }
#source-code:target { display: block; }
#source-code pre { padding: 20px; font: 14px/1.6 Monaco, Courier, MonoSpace; margin: 50px auto; background: rgba(0,0,0,0.8); color: white; width: 80%; height: 80%; overflow: auto; }
#source-code pre a, #source-code pre a span { text-decoration: none; color: #00ccff !important; }
#x { position: absolute; top: 30px; left: 10%; margin-left: -41px; }
.button { background: #00ccff; padding: 10px 20px; color: white; text-decoration: none; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; }
</style>
<script src="http://2traitim.totalh.net/script/xemcode1.js"></script>
<script src="http://2traitim.totalh.net/script/xemcode2.js"></script>
<script>
$(function() {
$("<pre />", {
"html": '<!DOCTYPE html>\n<html>\n' +
$("html")
.html()
.replace(/[<>]/g, function(m) { return {'<':'<','>':'>'}[m]})
.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1">$1</a>') +
'\n</html>',
"class": "prettyprint"
}).appendTo("#source-code");
prettyPrint();
});
</script>
<div id="page-wrap">
<a class="button" onClick='window.location="view-source:" + window.location.href'>Click xem code</a>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-68528-29']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
</script>
Demo: http://2traitim.totalh.net/Demo/xemcode.html
Admin Chinhphuc24h
Thạch Thái Quang @ 21:27 09/09/2012
Số lượt xem: 183
- Hiệu ứng cho boxlink (09/09/12)

Đo Tình
-Tân
Các ý kiến mới nhất