¿Cómo hacer links para "ver más"?

sokomizer

Hola.
Estoy desarrollando un blog en html y necesito escribir un post bastante largo, así que me gustaría saber cómo se hace un vínculo del tipo "ver más" o "clic para extender" y que al clicar aparezca el texto completo, para ahorrar un poco de espacio.
Muchas gracias de antemano.
Saludos.

erdanblo

En html?, hazlo a mano :S

sokomizer

El problema es que no sé nada de html...
¿Puede alguien escribir las instrucciones necesarias?
Estaría muy agradecido.

uNbiG

buscas que te digan como hacer algo en un lenguaje que no conoces no?... leete manuales xd

sokomizer

Mira, llevo haciendo eso desde antes de postear esto, el problema es que no sé cómo se llama lo que busco.
No hace falta que sigas comentando, porque sé que aquí hay gente que puede ayudarme y van de buen rollo.
Saludos.

erdanblo

A ver, a ver, a ver... aunque no conozcas el lenguaje, suponemos que sabes lo que es html, si tu quieres darle a un link y que te salga la noticia ampliada, tendrás que crear otro archivos en donde aparezca la noticia ampliada es decir:

// Página A

  • Noticia 1
    Texto corto... link a ver mas

  • Noticia 2
    Texto corto... link a ver mas

  • Noticia 3
    Texto corto... link a ver mas

// Página B

Seria donde al hacer clic en ver más se viese toda la noticia al completo.

Tienes que hacerlo todo a mano, la página en la que sale un poco y luego en la que sale el resto.

La otra opción es con algún lenguaje que te permita cortar el texto hasta cierto punto como php.

sokomizer

Ok. Muchísimas gracias, necesitaba antes estos conceptos. Ahora lo tengo claro.
Gracias de verdad.

uNbiG

ostia perdona que a veces se me va, pero suelo ayudar a la gente si puedo XDD

guner

Lo que dice erdanblo, es lo más común que se suele ver, pero se me ocurre una forma de que lo puedas hacer en un solo documento. La idea básica es que al principio, el cuerpo de la noticia esté en un div con una altura determinada y con overflow:elquehacequenoseveaeltextoynollevascroll, y que al hacer click en el vínculo se le atribuya al div una altura 'auto'.

Voy a probarlo, y si funca lo posteo.

PeLoTaSo

Con javascript se puede hacer, aunque ahora mismo no se como sería el código a utilizar, pero sería algo parecido al spoiler que hay en MV.

guner

#12, justo a lo que me refería yo.

&#65279;< ?xml version="1.0" encoding="utf-8"?>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

< html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

< head>
< title>Ver mas< /title>
< meta http-equiv="content-type" content="text/html; charset=utf-8" />
< style type="text/css" charset="utf-8" media="all">
html, body
{
font-family: Tahoma, sans;
padding: 0 0 0 0;
margin: 0 0 0 0;
}

	div
	{
		height: 4em;
		overflow: hidden;
		width: 420px;
		border: 1px solid #999;
		background-color: #eee;
	}
< /style>
< script language="javascript" type="text/javascript">
	var Noticias = Array ();
	
	function changeView(divId)
	{
		var HTMLobj = document.getElementById(divId).style;
		
		if (Noticias[divId] == 0 || !Noticias[divId]) {
			HTMLobj.height = 'auto';
			Noticias[divId] = 1;
		} else {			
			HTMLobj.height = '4em';
			Noticias[divId] = 0;
		}
	}
< /script>

< /head>

< body>
< div id="Noticia__N" class="NOculta">
What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
Where does it come from?
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. Where can I get some?
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
< /div>
< a href="javascript: changeView('Noticia__N'); ">Ver más...< /a>
< /body>

< /html>

sokomizer

WOW muchísimas gracias de verdad.
Pero... ¿Esto puedo aplicarlo en html o tengo que traducirlo?
Es que no entiendo demasiado de html o java script...
Perdón por las molestias.

sokomizer

Veamos, he hecho algunos pequeños progresos.
De momento sé cómo hacer para poner una capa en la que escribir el texto para que aparezca después.
Pero todavía no sé cómo definir el "oveflow" para que no se muestre desde el principio, sinó que lo haga al hacer clic en el enlace deseado.
¿Cómo puedo hacerlo?

Thanat0s

Lo que te han puesto arriba es lo que necesitas, fijate bien ;)

Usuarios habituales

  • Thanat0s
  • sokomizer
  • guner
  • PeLoTaSo
  • uNbiG
  • erdanblo