Cómo agregar botón para cambiar tamaño de texto en sitio web

  • Autor Autor ChatOrbi
  • Fecha de inicio Fecha de inicio
ChatOrbi

ChatOrbi

No recomendado
Como instalo un boton para agrandar y achicar el texto de la web?

Como esta señalado aqui:

1ISAW13.png
 
Como instalo un boton para agrandar y achicar el texto de la web?

Como esta señalado aqui:

1ISAW13.png

podrias ver el code fuente de esa pagina y ver como funciona... es un simple JS+CSS
 
podrias ver el code fuente de esa pagina y ver como funciona... es un simple JS+CSS

En el codigo fuente sale asi:

HTML:
<li class="icon_items">
<a class="text-less" href="#" onclick="achicarFuente(); return false;" title="Achicar Texto"></a>
<a class="text-more" href="#" onclick="aumentarFuente(); return false;" title="Agrandar Texto"></a>

Que archivo subo o que edito para que salga asi?
 
Dame la url de esto....
En el codigo fuente sale asi:

HTML:
<li class="icon_items">
<a class="text-less" href="#" onclick="achicarFuente(); return false;" title="Achicar Texto"></a>
<a class="text-more" href="#" onclick="aumentarFuente(); return false;" title="Agrandar Texto"></a>

Que archivo subo o que edito para que salga asi?
 
Aqui tienes las funciones de Javascript

PHP:
function aumentarFuente(){
		var currentFontSize = $('body').css('font-size');		
		if (currentFontSize < "16px") {
			var currentFontSizeNum = parseFloat(currentFontSize, 10);			
			var newFontSize = currentFontSizeNum + 1;
			$('body').css('font-size', newFontSize);
		}
		
		var currentFontSizeWP = $('.ms-WPBody').css('font-size');			
		if (currentFontSizeWP < "14px") {
			var currentFontSizeNumWP = parseFloat(currentFontSizeWP, 10);			
			var newFontSizeWP = currentFontSizeNumWP + 1;
			$('.ms-WPBody').css('font-size', newFontSizeWP);
		}
		return false;

	}
	  // Decrease Font Size
function achicarFuente(){
	  	var currentFontSize = $('body').css('font-size');
	  	if (currentFontSize > "13px") {	
	
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum - 1;	
		
			$('body').css('font-size', newFontSize);
	  	}
	  	
	  	var currentFontSizeWP = $('.ms-WPBody').css('font-size');
	  	if (currentFontSizeWP.substr(0,currentFontSizeWP.length - 2)  > "11") {	
			var currentFontSizeNumWP = parseFloat(currentFontSizeWP, 10);
			var newFontSizeWP = currentFontSizeNumWP - 1;			
			$('.ms-WPBody').css('font-size', newFontSizeWP);
	  	}
		return false;			

	  }
 
Atrás
Arriba