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

  • Home
  • SEARCH
  • 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 5843749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:11:51+00:00 2026-05-22T12:11:51+00:00

update: #div1 img { float: left; clear: left; margin: 10px; } #div2 img {

  • 0

update:

#div1 img   { float: left; clear: left; margin: 10px; }    
#div2 img  { float: right; clear: right; margin: 10px; }

i have three divs and three radiobuttons
rb1, rb2, rb3 and divs div1, div2, div3

when the user hover over the radiobutton1 then displays div1 … radiobutton2 then displays div2 etc…

the below code works fine.

my question is:

how can i use a single <div> containing the text and images (instead of three copies) and simply apply a CSS style to it depending on which radio button is hovered.?

<div id="div1">      
<img class="align-left" src="image.gif" /> 
some test.....div1
</div>

<div id="div2">      
<img class="align-right" src="image.gif" /> 
some test.....div2
</div>    

<div id="div3">      
<img class="align-left" src="image.gif" /> 
<img class="align-right" src="image1.gif" /> 
some test.....div3
</div>


$('#_rbl').hover(              
    function (){         
     $('#div1').dialog('open');     
});

$('#_rb2').hover(              
    function (){         
     $('#div2').dialog('open');     
});

$('#_rb3').hover(              
    function (){         
     $('#div3').dialog('open');     
});
  • 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-22T12:11:52+00:00Added an answer on May 22, 2026 at 12:11 pm

    How about:

    <div id="theDiv">      
    <img class="align-left" src="image.gif" /> 
    some test.....div1
    </div>
    
    $('#_rbl').hover(              
        function (){         
         $('#theDiv').removeClass("rb1 rb2 rb3").addClass("rb1").dialog('open');
    });
    
    $('#_rb2').hover(              
        function (){         
         $('#theDiv').removeClass("rb1 rb2 rb3").addClass("rb2").dialog('open');     
    });
    
    $('#_rb3').hover(              
        function (){         
         $('#theDiv').removeClass("rb1 rb2 rb3").addClass("rb3").dialog('open');     
    });
    

    UPDATE (create the classes like so):

    .rb1 img { float: left; clear: left; margin: 10px; }    
    .rb2 img { float: right; clear: right; margin: 10px; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sequence of couples of elements. (.div1, .div2) I'm using position:relative attribute
Update: giving a much more thorough example. The first two solutions offered were right
UPDATE I have reverted back to Jquery 1.3.2 and everything is working, not sure
Is it possible to somehow shorten this code: var i=GetStringFromServer('/url'); if(i){ $('#Div1').hide(); $('#Div2').show(); }
UPDATE : I got my O3D situation straightened out, but I have yet to
UPDATE - No need to answer this now, I have solved below. Hi, I'm
This is weird I have markup like this <div id='div1'> <ul id='ul1'> <li>1</li> <li>2</li>
UPDATE : I have this SSMS tools pack which wraps everything in this -
I have a view where ill have 3 divs: Div 1: List of Brands
UPDATE: Now looking for Package Name as opposed to PID I have an app

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.