Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    3
    Plugin Contributions
    0

    Default Display hidden Div on "Add to cart" button click.

    Hi Everyone, hopefully one of you can help me with this small issue as I cannot find exact details anywhere on the forum.

    I am trying to add an animated .gif (repeating loading image) inside an initially hidden div below the "Add to cart" button. I would then require the div to load once the user clicks on the "add to cart" button.

    The reason for adding this feature is so when a user chooses to upload a file with their order, instead of them thinking the browser has crashed whilst the file is uploading, a loading image will appear and will ensure they don't quit.

    I have already successfully added the div to the "tpl_product_info_display.php" file below the add to cart section.

    Can anyone tell me what code I need to add to hide the div initially, and have it appear when the "Add to cart" button is clicked.

    Many thanks in advance!

  2. #2
    Join Date
    Sep 2008
    Posts
    13
    Plugin Contributions
    0

    Default Re: Display hidden Div on "Add to cart" button click.

    Quote Originally Posted by deltacreative View Post
    Hi Everyone, hopefully one of you can help me with this small issue as I cannot find exact details anywhere on the forum.

    I am trying to add an animated .gif (repeating loading image) inside an initially hidden div below the "Add to cart" button. I would then require the div to load once the user clicks on the "add to cart" button.

    The reason for adding this feature is so when a user chooses to upload a file with their order, instead of them thinking the browser has crashed whilst the file is uploading, a loading image will appear and will ensure they don't quit.

    I have already successfully added the div to the "tpl_product_info_display.php" file below the add to cart section.

    Can anyone tell me what code I need to add to hide the div initially, and have it appear when the "Add to cart" button is clicked.

    Many thanks in advance!
    Deltacreative,
    You may have already found your answer to this. I stumbled on your post while I was looking for something else and thought I'd give you an example that you could apply to your situation in case you are still looking for a solution. Hope this helps you or someone else that is looking for it.

    HTML Code:
    <script type="text/javascript">
    function change(id, newClass)
    {
    identity=document.getElementById(id);
    identity.className=newClass;
    }
    
    </script>
    <style type="text/css">
    div.hidden {
    display: none;
    }
    div.promptshow {
    background: #bbb;
    display: block;
    }
    </style>
    </head>
    <body>
    <div>
    <a href="#" onclick="change('hiddendiv1', 'promptshow');">Display div 1</a>
    <a href="#" onclick="change('hiddendiv2', 'hidden');">hide div 2</a>
    
    <div class="hidden" id="hiddendiv1">hide this div</div>
    <div id="hiddendiv2">previously hiding div</div>
    
    </div>

 

 

Similar Threads

  1. Replies: 2
    Last Post: 3 Mar 2016, 10:02 PM
  2. Replies: 0
    Last Post: 2 Jan 2011, 01:14 PM
  3. Replies: 26
    Last Post: 19 Feb 2010, 02:56 AM
  4. How to Remove just one "Display Product Add to Cart Button"?
    By scottwww1 in forum General Questions
    Replies: 12
    Last Post: 29 Oct 2009, 12:39 AM
  5. Problems when I click the "add to add to cart" button
    By brokntrigun in forum General Questions
    Replies: 0
    Last Post: 30 Sep 2007, 06:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR