المواضيع الأخيرة
كود لتحديد حجم الخط المفضل للزوار
صفحة 1 من اصل 1 • شاطر
كود لتحديد حجم الخط المفضل للزوار
السلام عليكم ورحمة الله وبركاته
- صورة للوصف:
الكود يصلح للمنتديات التالية
PhpBB3
PunBB
Invision
PunBB
Invision
قد لايعمل الكود لمن حدد نوع و حجم معين بكود ما في منتداه
لوضع الكود
لوحة الادارة عناصر اضافية ادارة صفحات javascripte
الإسم : تحديد حجم الخط
جميع الصفحات
- الكود:
$(function() {
'DEVELOPED BY ANGE TUTEUR';
'NO DISTRIBUTION WITHOUT CONSENT OF THE AUTHOR';
'ORIGIN : four.banouta.net';
// font sizes
var sizes = [
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24
],
// position of the selector
// 0 = top
// 1 = bottom
position = 0,
attachTo = '#page-body, #ipbwrapper #content-container', // element(s) where the selector will be attached
// language config
lang = {
Default : 'Default',
FontSize : 'Font Size : '
},
cookie = my_getcookie('fa_fontsize'), // selected font size
selector = $('<select id="fa_fontsize" />')[0], // font size selector
container = $('<div id="fa_fontsize_container"><span id="fa_fontsize_label" style="font-size:12px">' + lang.FontSize + '</span></div>')[0], // selector container
// options string
html = '<option value="default:' + window.getComputedStyle(document.body, null).getPropertyValue('font-size') + '" ' + ( /default/i.test(cookie) ? 'selected' : '' ) + '>' + lang.Default + '</option>',
// loop variables
i = 0, j = sizes.length,
// function for changing the font size
change = function(init, val) {
var value = init === true ? val : this.value;
my_setcookie('fa_fontsize', value);
document.body.style.fontSize = /default/i.test(value) ? value.replace(/default:/, '') : value + 'px';
};
// loop through the sizes array to create an options list for the selector
for (; i < j; i++) {
html += '<option value="' + sizes[i] + '" ' + (cookie == sizes[i] ? 'selected' : '') + '>' + sizes[i] + '</option>';
}
// apply the html and event handler to the selector
selector.innerHTML = html;
selector.onchange = change;
// apply the chosen font size if any was selected
if (cookie) {
change(true, cookie);
}
// add the selector to the container and finally the document
container.appendChild(selector);
$(attachTo)[['prepend', 'append'][position]](container);
});
صفحة 1 من اصل 1
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى
10/1/2017, 9:56 pm من طرف admin
» كود رائع أيقونة منبثقة تمكنك من تعديل الموضوع من المنتدى الثانوي
10/1/2017, 8:50 pm من طرف admin
» كود حصري و انفرادي
10/1/2017, 7:52 pm من طرف admin
» كود اخر المواضيع الرائع
9/1/2017, 11:48 pm من طرف admin
» كود حصري ورائع جدا : نافدة الدخول منبثقة
8/1/2017, 8:52 pm من طرف admin
» كود تغيير زر الرموز من المحرر
8/1/2017, 8:34 pm من طرف admin
» لمن يريد أي إستفسار أة طرح أسئلة
8/1/2017, 4:40 pm من طرف admin