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 78495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:59:47+00:00 2026-05-10T20:59:47+00:00

I have this code, which works fine, but I would like to be able

  • 0

I have this code, which works fine, but I would like to be able to make it so when an image appears the text layer disapears, and there would be a link to bring the xt back and remove the image. How would I do this…, something to do with changing isibility and overlaying?

<html>   <script type='text/javascript'>     //<!--     function sbox(boxName, xname) {       theBox = document.getElementById(boxName);       theBox.className = xname;     }     //-->   </script>    <style>     #main {       position: absolute;       width: 800px;       height: 600px;     }     .test1 {       position: absolute;       top: 20px;       width: 80px;       height: 80px;       border-style: solid;       border-color: green;     }     .test2 {       position: absolute;       top: 120px;       width: 80px;       height: 80px;       border-style: solid;       border-color: red;     }     .test3 {       position: absolute;       top: 220px;       width: 80px;       height: 80px;       border-style: solid;       border-color: blue;     }     .test4 {       position: absolute;       top: 320px;       width: 80px;       height: 80px;       border-style: solid;       border-color: black;     }     .test5 {       position: absolute;       top: 20px;       width: 80px;       height: 80px;       border-style: solid;       border-color: yellow;     }     #test6 {       width: 80px;       height: 80px;       border-style: solid;       border-color: green;     }     #test7 {       width: 80px;       height: 80px;       border-style: solid;       border-color: green;     }   </style>   <div class='test1' id='test1'>     <a href='#' onclick='sbox('test1', 'test5'); return false;'>test1</a>   </div>   <div class='test2' id='test2'>test2</div>   <div class='test3' id='test3'>test3</div>   <div class='test4' id='test4'>test4</div> </html> 
  • 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. 2026-05-10T20:59:47+00:00Added an answer on May 10, 2026 at 8:59 pm

    Play with the display property:

    <div id='text1'>Some text here</div> <a href='' onClick='toggleImg('text1');return false;'>Show</a></div> <div id='text1_img' style='display:none'><img src='/your/image_text1.png' /></div>  <div id='text2'>Some text here</div> <a href='' onClick='toggleImg('text2');return false;'>Show</a> <div id='text2_img' style='display:none'><img src='/your/image_text2.png' /></div>  <div id='text3'>Some text here</div> <a href='' onClick='toggleImg('text3');return false;'>Show</a> <div id='text3_img' style='display:none'><img src='/your/image_text3.png' /></div> 

    And then, a JS function:

    <script type='text/javascript'> function toggleImg(myid) {   objtxt = document.getElementById(myid);   objimg = document.getElementById(myid+'_img');    if( objtxt.style.display == 'block' ) // Show image, hide text   {     objtxt.style.display = 'none';     objimg.style.display = 'block';   }   else                                  // Hide image, show text   {     objimg.style.display = 'none';     objtxt.style.display = 'block';   }  } </script> 

    I hope you’ll be able to apply this to your needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code which compiles and works as expected: class Right {}; class
I have this code in my cfm, which works <cfif not StructIsEmpty(form)> <cfset larray
I have this code which gets WP posts, but it gets all the posts
I have this code which should create a splash image with either no animation
Problem Hello all! I have this code which takes my jpg image loops through
I have this code which is called at an onChange event of an function
I have this code (which is way simplified from the real code): public interface
I have this code which will include template.php file from inside each of these
I am trying to compare two dates. I have this code which I thought
i would like to implement a function in R which is able to increase

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.