Forums

jquery show/hide div not working (4 posts)

  1. Summit10
    Member
    Posted 1 year ago #

    Hi all,

    I have an e-comerce site build over a WP + e-Commerce with a premium theme I bought and I have a little problem with a little script that should hide one div and it does not. The code is this:

    <input type="button" value="+/- Información" onclick='$("#nombre_div").toggle(200);'>
    <div id="nombre_div">
          <div class="wpsc_description">
                      <?php echo wpsc_the_product_description(); ?>
          </div><!--close wpsc_description-->
    </div>

    I have added a call to jquery in the header although I think it is included in Wp by default. I explain that this div (wpsc_description) is the one that shows the description of every single product in the products page. Maybe the IDs should be dinamic instead of static? I don't know what's wrong, If I use it in an HTML file (same server) works perfectly.

  2. Nikglavin
    Member
    Posted 1 year ago #

    i don't know if you should have your jquery in the onclick=""??? seems strange to me generally i would call it as a jquery function at the foot of the html ??

  3. Summit10
    Member
    Posted 1 year ago #

    Yes, it works fine in an external HTML, i've tried it. It's just in this file that I don't know why but it does not work.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags