Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3229318
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:47:48+00:00 2026-05-17T16:47:48+00:00

for example ive got a div like: <div class=y1> <img src=i/o.png /> </div> and

  • 0

for example ive got a div like:

<div class="y1">
<img src="i/o.png" />
</div>

and

<!-- pre load -->
<div class="p1" style="display:none">
<h5 class="ob">Title</h5>
<img class="ob" src="i/ob.png" />
<small class="ob">Description</small>
<a href="#" class="oyna">PLAY</a>
</div>

and this jquery

<script type="text/javascript">

$("div.y1").hover(
  function () {
    $('div.p1').slideDown('slow', function() {
  });
  }
);
</script>

my question is how can i repeat it for 12 times. i mean when i hover on y1, show p1, y2 => p2, y3 => p3 … y12 => p12. i hope you guys understand me. thank you so much!!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:47:49+00:00Added an answer on May 17, 2026 at 4:47 pm

    I’m going to assume that your y# divs are inside a div with the id container. Secondly, I’m going to assume that none of your y# divs have any other classes applied to them.

    $('#container').delegate('div[class^=y]','mouseenter', function(){
        $('div.p' + this.className.slice(1)).slideDown('slow');
    }).delegate('div[class^=y]', 'mouseleave', function(){
        $('div.p' + this.className.slice(1)).slideUp('slow');
    });
    

    This uses delegate to avoid the cost of binding to multiple DOM elements.


    Edit To hide the p# div on hovering on another element, you can use this code.

    $('#container').delegate('div[class^=y]','mouseenter', function(){
        $('div.p' + this.className.slice(1)).slideDown('slow').siblings().slideUp();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

got a problem with dets:to_ets/2 Could somebody point me to an example online? Ive
I've got a list item with an image inside, for example: <ul> <li> <img></img>
I've got my site content inside an 800px-wide div, I'd like that div to
I have, for example, markup like this <div id=content> <p>Here is some wonderful text,
I've got a page with two sets of div like so <div id=set1> <div
I've basically got an XML input structure like this: ... <box type=rectangle class=someOriginalClass> <background
I've got a load of non local images which I'd like to render as
I've got coordinates of one pixel of my image (for example int i,j; ),
I've got an example from documentation for Text.Parsec.Expr . expr = buildExpressionParser table term
i've got following example xml: <entity id=1> <name>computer</name> <type>category</type> <entities> <entity id=2> <name>mac</name> <type>category</type>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.