File này mình sử dụng không được nữa cho skin fmvi pro ver 1 : [You must be registered and logged in to see this link.] Admin cho mình xin file JS chọn nội dung Code mà forum đang dùng nhé. Cảm ơn |
File này mình sử dụng không được nữa cho skin fmvi pro ver 1 : [You must be registered and logged in to see this link.] Admin cho mình xin file JS chọn nội dung Code mà forum đang dùng nhé. Cảm ơn |
function selectCode(a)
{
// Get ID of code block
var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
// Not IE
if (window.getSelection)
{
var s = window.getSelection();
// Safari
if (s.setBaseAndExtent)
{
s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
}
// Firefox and Opera
else
{
// workaround for bug # 42885
if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
{
e.innerHTML = e.innerHTML + ' ';
}
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
}
// Some older browsers
else if (document.getSelection)
{
var s = document.getSelection();
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
// IE
else if (document.selection)
{
var r = document.body.createTextRange();
r.moveToElementText(e);
r.select();
}
}
jQuery(document).ready(function(){
jQuery(".codebox dt").html('Cod: <a href="#" id="select" onclick="selectCode(this); return false;" style="float: right; color: white; font-weight: bold; margin-right: 40px; text-shadow: 1px 1px 0 black;">Chọn code</a>');
});
jQuery(document).ready(function(){
jQuery(".codebox.spoiler dt").html('Spoiler: <a href="#" id="select" onclick="selectCode(this); return false;" style="float: right; color: white; font-weight: bold; margin-right: 40px; text-shadow: 1px 1px 0 black;">Chọn code</a>');
});
Bư đã viết:Chèn vào js chọn : In all the pages
- Code:
function selectCode(a)
{
// Get ID of code block
var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
// Not IE
if (window.getSelection)
{
var s = window.getSelection();
// Safari
if (s.setBaseAndExtent)
{
s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
}
// Firefox and Opera
else
{
// workaround for bug # 42885
if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
{
e.innerHTML = e.innerHTML + ' ';
}
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
}
// Some older browsers
else if (document.getSelection)
{
var s = document.getSelection();
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
// IE
else if (document.selection)
{
var r = document.body.createTextRange();
r.moveToElementText(e);
r.select();
}
}
jQuery(document).ready(function(){
jQuery(".codebox dt").html('Cod: <a href="#" id="select" onclick="selectCode(this); return false;" style="float: right; color: white; font-weight: bold; margin-right: 40px; text-shadow: 1px 1px 0 black;">Chọn code</a>');
});
jQuery(document).ready(function(){
jQuery(".codebox.spoiler dt").html('Spoiler: <a href="#" id="select" onclick="selectCode(this); return false;" style="float: right; color: white; font-weight: bold; margin-right: 40px; text-shadow: 1px 1px 0 black;">Chọn code</a>');
});
Cảm ơn Bư |
Similar topics
|
|