Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Jquery Tutorial #1 Mostrar y Ocultar DIV con animación
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<title>Tutorial jQuery Remasterizado</title>
<script src=""></script>
var pagina = $(document);
pagina.on("ready", animar);
function animar() {
var x = $("#mostrar_elemento");
x.on("click", mostrar);
var y = $("#ocultar_elemento");
y.on("click", ocultar);
function mostrar() {
var x = $("div");"slow");
function ocultar() {
var x = $("div");
.ocultado {
display: none;
background-color: #9c0;
border-color: #063;
border-style: dotted;
border: thin;
width: 200px;
height: 200px;
<input id="mostrar_elemento" type="button" value="Mostrar mensaje" />
<input id="ocultar_elemento" type="button" value="Ocultar" />
<div class="ocultado">
Esta div se esta mostrando sin embargo puede ser cualquier elemento
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.