Thay đổi cỡ chữ, màu nền, độ rộng trang trong Joomla Template JoomArt.
Chèn mã HTML vào vị trí bạn muốn Tool này xuất hiện.
Mã HTML:
<div id="ja-usertoolswrap">
<div id="ja-usertools">
<span class="ja-usertools">
<div id="fontsize">
<script type="text/javascript">
//<![CDATA[
document.write('<h3><?php echo JText::_('FONTSIZE'); ?></h3><p class="fontsize">');
document.write('<a href="/cntt/index.php" title="<?php echo JText::_('Increase size'); ?>" onclick="changeFontSize(2); return false;" class="larger"><?php echo JText::_('bigger'); ?></a><span class="unseen"> </span>');
document.write('<a href="/cntt/index.php" title="<?php echo JText::_('Decrease size'); ?>" onclick="changeFontSize(-2); return false;" class="smaller"><?php echo JText::_('smaller'); ?></a><span class="unseen"> </span>');
document.write('<a href="/cntt/index.php" title="<?php echo JText::_('Revert styles to default'); ?>" onclick="revertStyles(); return false;" class="reset"><?php echo JText::_('reset'); ?></a></p>');
//]]>
</script>
</div>
<a onclick="setScreenType('narrow');return false;" href="#Narrow">
</a>
<a onclick="setScreenType('wide');return false;" href="#Wide">
</a>
<a onclick="setScreenType('auto');return false;" href="#Auto">
</a>
<a onclick="changeFontSize(1); return false;" href="#Increase">
</a>
<a onclick="changeFontSize(-1); return false;" href="#Decrease">
</a>
<a onclick="revertStyles(3); return false;" href="#Default">
<img id="ja-tool-reset" alt="Default font size" src="/images/user-reset.gif" title="Default size"/>
</a>
</span>
<script type="text/javascript">
var curtool = document.getElementById('ja-tool-wide');
</script>
<div id="ja-search">
</div>
</div>
</div>
Mã Javascript lưa vào file ja.script.js:
<script type="text/javascript">
var currentFontSize = 4;
function revertStyles(fontsize){
currentFontSize = fontsize;
changeFontSize(0);
}
function changeFontSize(sizeDifference){
//get css font size
var rule = getRuleByName("body.fs" + (currentFontSize + sizeDifference));
if (rule){
document.body.style.fontSize = rule.style.fontSize;
currentFontSize = currentFontSize + sizeDifference;
createCookie("ja_pollux_ja_font", currentFontSize, 365);
}
return;
};
function getRuleByName(ruleName){
for (i=0; i<document.styleSheets.length; i++){
var style = document.styleSheets[i];
var rules = style.cssRules?style.cssRules:style.rules;
if (rules){
for (j = 0; j<rules.length; j++){
if (rules[j].selectorText.trim().toUpperCase() == ruleName.trim().toUpperCase()){
return rules[j];
}
}
}
}
return null;
}
function setActiveStyleSheet(title) {
createCookie("ja_pollux_ja_color", title, 365);
window.location.reload();
return;
var i, a, main, arr;
arr = document.getElementsByTagName("link");
for(i=0; (a = arr[i]); i++) {
var ltitle = a.getAttribute("title");
if(a.getAttribute("rel").indexOf("style") != -1 && ltitle) {
a.disabled = true;
if(ltitle == title) a.disabled = false;
}
}
createCookie("ja_pollux_ja_color", title, 365);
}
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function setScreenType(screentype){
bclass = document.body.className.trim();
if (bclass.indexOf(' ') > 0){
bclass = bclass.replace(/^\w+/,screentype);
}else{
bclass = screentype + ' ' + bclass;
}
document.body.className = bclass;
createCookie("ja_pollux_ja_screen", screentype, 365);
}
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };
function changeToolHilite(oldtool, newtool) {
if (oldtool != newtool) {
if (oldtool) {
oldtool.src = oldtool.src.replace(/-hilite/,'');
}
newtool.src = newtool.src.replace(/.gif$/,'-hilite.gif');
}
}
//addEvent - attach a function to an event
function addEvent(obj, evType, fn){
if (obj.addEventListener){
obj.addEventListener(evType, fn, false);
return true;
} else if (obj.attachEvent){
var r = obj.attachEvent("on"+evType, fn);
return r;
} else {
return false;
}
}
</script>
Đang cập nhật
| Tạo link thân thiện SEO/SEF < Lùi | Tiếp theo > Hướng dẫn cài đặt Joomla 1.5 |
|---|
Tin mới hơn:
- 26/05/2009 21:29 - Cài đặt Joomla 1.5 extensions
- 12/05/2009 16:20 - Tạo module position mới trong Joomla
- 11/05/2009 08:19 - Sửa lỗi JoomSEF trong Joomla
- 09/05/2009 15:06 - Thay đổi trình biên tập WYSIWYG editor trong Joomla
- 08/05/2009 16:45 - Cách sử dụng Code Highlighter GeSHi plugin/mambot trong Joomla
Tin cũ hơn:
- 03/05/2009 17:26 - Tạo quảng cáo nhiều hiệu ứng trong Joomla sử dụng jQuery
- 20/04/2009 18:12 - Tạo module trượt 2 bên trong Joomla
- 08/04/2009 17:11 - Điều khiển vùng mainbody trên trang chủ Joomla
- 07/04/2009 22:34 - Viết Joomla plugin trong Joomla 1.5
- 07/04/2009 00:51 - Tối ưu hóa Joomla 1.5
Download Game bóng đá PES8 Việt Nam
Tải game bóng đá FiFa 09
Tải game Dragon ball Z - 7 viên ngọc rồng
Tải Game Bóng Đá Pro Evolution Soccer 6 Việt Nam
Download PES 2011 patch Việt Nam PESVN
Tải Game Bóng Đá FIFA 2009 RIP 1 CD
Download Pro Evolution Soccer 2011
Download Game THE SIMS 3
Tải Game bóng đá PES 2009
Download PES 2011 demo
Thay đổi màn hình đăng nhập Windows 7 bằng tay
Một số hàm hay dùng trong JavaScript
Kiểm soát hoàn toàn trỏ chuột bằng bàn phím với NeatMouse
Choáng với concept của Windows Phone 8
Những đặc điểm ưu việt của Windows Phone
Ứng dụng gọi điện VoIP Viber sắp có mặt trên Windows Phone
Game Diablo 3 sắp có mặt trên Windows Phone Marketplace
37 trang css & xhtml web template miễn phí tuyệt đẹp
Những điều cơ bản cần biết về bàn phím chơi game - Gaming Keyboard
L.A. Noire: The Complete Edition - THETA [Full ISO/Action/2011] [13.37GB]
Download 7554 demo
Download Game PC, cập nhật liên tục (torrent)
PES 2012 ra mắt bản mở rộng đầu tiên vào 11/10
PES2012 - Full version - Ngôn ngữ và bình luận tiếng Anh
PES2012 - Blurry disable làm mịn đồ họa
PES 2011 PATCH 4.1 - TRANSFER UPDATE - RELEASED
Bộ sưu tập free PrestaShop Themes phần 3
Bộ sưu tập theme Prestashop miễn phí phần 2
Top 10 Free PrestaShop Themes
Download Prestashop 1.5
Download PrestaShop 1.4
Bổ sung Memcached vào PrestaShop 1.4
Hướng dẫn tích hợp Ngân Lượng vào PrestaShop
Sửa lỗi invalid carrier or no carrier selected trong PrestaShop
Cài đặt PrestaShop
Thiết kế giao diện PrestaShop Theme
Hướng dẫn cài đặt themes trong PrestaShop
Hướng dẫn cách thêm ngôn ngữ cho PrestaShop
Bộ sưu tập Giao diện Premium PrestaShop Themes chuyên nghiệp
Giới thiệu về website thương mại điện tử 2.0 Prestashop
Hướng dẫn chơi Grand Theft Auto: Vice City phần 1
Nero Burning Rom 9.4.26 Portable - Phần mềm ghi đĩa tốt nhất


