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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:03:20+00:00 2026-06-05T06:03:20+00:00

This is my css and Jquery i created this two functions to show text

  • 0

This is my css and Jquery i created this two functions to show text when an image in a table is clicked, then if the text is clicked it shows the image again.

<style>
.espanto {
    margin:0px 25px 0px 25px;
    display:none;
}

</style>
  <script>
function showImage(){
                $('.espanto').show();
                $('.hide').hide();
            }
            function hidonio(){
                $('.espanto').hide();
                $('.hide').show();
            }
</script>

Then i have this structure. here is where i coded the table and use the classes to make it happen

  <div id="content">
    <p align="center"><span class="titles" style="color:#1A4487; line-height:10px;">Productos Artesanales Gourmet</span></p>
    <div class="bar"></div>
    <p class="parag" style="  ">Kanaan le ofrece una extensa seleccion de conservas, chutneys, aceites y salsas, que le brindaran ese sabor que usted estaba buscando, por favor no dude en contactarnos si desea una cotizacion o muestras gratis, de clic en alguna imagen para ver su descripcion.</p>
    <p align="center"><span class="titles espanto" style="color:#1A4487; line-height:10px;"><br />
      Descripciones.</span></p>
    <table align="center" style="color:#1A4487;" width="650" border="0">
      <tr>
        <td width="250px"><p class="titles" align="center" > <span class="parag espanto"><br />
             <a href="#" onclick="hidonio()" >Producto de origen Hindú que sirve para acompañar y hornear carnes como pescado, pollo, cerdo, etc. Dándole un exquisito sabor a sus platillos, sabores: ciruela, tamarindo, carambolo, calabaza,  durazno y piña</a></span><a href="#" onclick="showImage()" ><img src="pr/Chutneys 2.jpg" height="200" class="hide" /></a><br />
            Chutneys</p></td>
        <td width="250px"><p class="titles" align="center"><span class="parag espanto"><br />
            <a href="#" onclick="hidonio()" > Aceites aderezados para saborizar carne y ensaladas de sabor canela, romero, laurel, thai, (rojo y picante), y hiervas finas</a></span><a href="#" onclick="showImage()" ><img src="pr/Aceites 2 a.jpg" height="200" class="hide"/></a><br />
            Aceites </p></td>
        <td width="250px"><p class="titles" align="center"> <span class="parag espanto"><br />
             <a href="#" onclick="hidonio()" >Conservas dulces (frutas en almíbar)<br />
            De todo tipo de frutas (guayaba, mango, durazno, piña, camote, calabaza, etc.)<br />
            <br />
            Conservas saladas (encurtidos)
            En salmuera o en vinagre (col morada, calabacita, espárragos, chichar
  • 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-06-05T06:03:20+00:00Added an answer on June 5, 2026 at 6:03 am

    You should follow the jQuery approach of unobtrusive JavaScript and avoid inline functions and onclick handlers.

    Instead use a selector to define a click event on your element like this:

    $('.titles a:first').on('click', function(){
      $(this).closest('p').find('.espanto').hide();
      $(this).closest('p').find('.hide').show();
    });
    

    This is basically your first scenario. The second will work analogical with $('.titles a:last')....

    Have a look at the jQuery documentation for on, selectors and traversing


    Update

    Here is a working jsFiddle that should do what you want. The code above is not completely working, especially the selector is false to get the links. Here is the update from the fiddle:

    $('table td').find('a:first').on('click', function(){
        $(this)
            .parent()
                .hide()
            .parent().find('img').show();
    }).end()
        .find('a:last').on('click', function(){
            $(this).hide()
                .closest('td').find('span:first').show();
        });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This CSS style applies to links inside a table which the class property is
I am using a menu system from this website CSS/Jquery Menu In chrome the
IE doesn't like the sharp symbol in the line below jQuery(this).css('background-color','#' + jQuery(this).prev().val()); so
How to make this css code cross browser compatible using jquery. this code only
I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,
I use the following jquery statements, $(.resultsdiv:odd).css(background-color, #fff); $(.resultsdiv:even).css(background-color, #EFF1F1); $('.resultsdiv').hover(function() { $(this).css('background-color', '#f4f2f2');
I'm using the jquery .css property to add a background myobj.css('background', '#AE0000'); This results
In this link: http://css-tricks.com/snippets/jquery/jquery-plugin-template/ it has a line of code that says // Add
I am using this code: $('.ui-accordion').bind('accordionchange', function(event, ui) { $(this).next().next().css({'background-image':'images/green-bg.jpg'}); //ui.newHeader // jQuery object,
I've created a Jquery slideshow and it is working without problem, but this thing

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.