Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
JQuery mostrar/ocultar al pasar el mouse

Tengo tres enlaces, Gato, Perro, Serpientes. Cuando paso el mouse sobre cada uno, el contenido relacionado con cada enlace debe cambiar.

Entonces, si coloco el cursor sobre el gato, aparecerá el contenido del gato, si coloco el cursor sobre el perro, el contenido del gato desaparecerá suavemente y aparecerá el contenido del perro... y así sucesivamente.

Los enlaces son: Perro Gato Serpiente
<div> <span style="display:none;"> Cat Content</span> <span style="display:none;"> Dog Content</span> <span style="display:none;"> Snake Content</span> </div>

¿Cómo hago para que esto funcione completamente, con un poco de desvanecimiento suave?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

('.cat').hover( function () { $(this).show(); }, function () { $(this).hide(); } );

Es lo mismo para los demás.

Para un desvanecimiento suave, puede usar fadeIn y fadeOut

over 4 years ago · Santiago Trujillo Report

0

jquery:

 $('div.animalcontent').hide(); $('div').hide(); $('p.animal').bind('mouseover', function() { $('div.animalcontent').fadeOut(); $('#'+$(this).attr('id')+'content').fadeIn(); });

html:

 <p class='animal' id='dog'>dog url</p><div id='dogcontent' class='animalcontent'>Doggiecontent!</div> <p class='animal' id='cat'>cat url</p><div id='catcontent' class='animalcontent'>Pussiecontent!</div> <p class='animal' id='snake'>snake url</p><div id='snakecontent'class='animalcontent'>Snakecontent!</div>

-editar-

sí claro, aquí tienes -- JSFiddle

over 4 years ago · Santiago Trujillo Report

0

Espero que mi guión te ayude.

 <i class="mostrar-producto">mostrar...</i> <div class="producto" style="display:none;position: absolute;">Producto</div>

mi guion

 <script> $(".mostrar-producto").mouseover(function(){ $(".producto").fadeIn(); }); $(".mostrar-producto").mouseleave(function(){ $(".producto").fadeOut(); }); </script>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!