maram2012 { بنوته حلوة }
| المشاركات | : 83 | نقاطي | : 20
| موضوع: طلب هذا الكود من أختي مالي مزاج الجمعة ديسمبر 07, 2012 6:26 pm | |
| | |
|
maly-mzaj
المدير العام
| المشاركات | : 1533 | نقاطي | : 1737 | تاريخ ميلادي | : 17/03/1986 | عمري | : 38
| موضوع: رد: طلب هذا الكود من أختي مالي مزاج الجمعة ديسمبر 07, 2012 7:47 pm | |
| سيتم التعديل على الكود للنسخة الثالثة ----------------------------------------------- كود تحديد المحتوى للنسخة الثانية والثالثة يتغير شكل الكود عن الماضي - الكود:
-
function selectCode(a) { // Get ID of code block var e = jQuery(a).closest('tr').next().find('.cont_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(function(){
jQuery('div.postbody td.code').parent().prev().find('b').html('Code: <a href="javascript:void()" onClick="selectCode(this)"><font face="verdana" color="red"></font> Selectati Continutul </a>'); }); | |
|