3
ok i'm trying to adapt the font resizer from
morphogenesis3i copied morpho.js to my themes js folder
/*
* Mor.pho.GEN.e.sis 3.0
*
* @package themes
* @since 2.4.x
* @maintained Afux
*
* @version $Id
*/
/* text sizer */
function fsize(size,unit,id){
var vfontsize = document.getElementById(id);
if(vfontsize){
vfontsize.style.fontSize = size + unit;
}
}
var textsize = 1;
function changetextsize(up){
if(up){
textsize = parseFloat(textsize)+0.05;
}else{
textsize =parseFloat(textsize)-0.05;
}
}
/* show hide id */
function xoToggleBlock( id )
{
var value = (document.getElementById(id).style.display == 'none') ? 'block' : 'none';
xoSetBlock( id, value );
xoSetCookie( id, value );
}
function xoSetBlock( id, value )
{
document.getElementById(id).style.display = value;
}
function xoTrim( str )
{
return str.replace(/^s+|s+$/g, '') ;
}
function xoGetCookie( name )
{
var cookieName = 'XoMorpho_' + name;
var cookie = document.cookie;
var cookieList = cookie.split( ";" );
for( var idx in cookieList )
{
cookie = cookieList[idx].split( "=" );
if ( xoTrim( cookie[0] ) == cookieName )
{
return( cookie[1] );
}
}
return 'none';
}
function xoSetCookie( name, value )
{
var cookieName = 'XoMorpho_' + name;
var expires = new Date();
expires.setTime( expires.getTime() + (365 * 24 * 60 * 60 * 1000));
document.cookie = cookieName + "=" + value + "; expires=" + expires + ";";
}
<script src="http://xxxxxxxx/themes/xxxxxxxxxx/js/morpho.js" type="text/javascript">script>
change x0-canvas colum to mainBody...copy all the icon image to my theme folder
<a href="javascript:fsize(textsize,'em','mainBody');" onclick="changetextsize(1);" title=""><img class="xo-icons" src="<{xoImgUrl icons/action/zoom_in.png}>" alt="A +" title="<{$smarty.const.THEME_ACCESS_PLUS}>" />a>
<a href="javascript:fsize(1,’em’,'mainBody’);" onclick="textsize = 1" title=""><img class="xo-icons" src="<{xoImgUrl icons/action/zoom_reset.png}>" alt="A =" title="<{$smarty.const.THEME_ACCESS_RESET}>" />a>
<a href="javascript:fsize(textsize,'em','mainBody');" onclick="changetextsize(0);" title=""><img class="xo-icons" src="<{xoImgUrl icons/action/zoom_out.png}>" alt="A -" title="<{$smarty.const.THEME_ACCESS_MINUS}>" />a>
all is working except the
the reset button ...when clicking nothing happens
help......