Open/close contact owner form with accordion functionality

Discussion in 'TemplateCodes' started by zooi, Jan 15, 2011.

  1. zooi Customer

    C68 version: v4.2.1 Developer, template Sigma

    Hello,

    I try to add accordion fuctionality to the contact owner form in contactowner.tpl so that it is closed untill a visitor wants to contact the advertiser of the listing.
    I have used the same functionality as in the accordion.tpl and this works partly because now also the left menu (accordion) open/close if I click to open the contact owner form link.
    I have tried to modify layout.js without succes.
    Is it possible to use multiple accordion functionality at one site page?

    Who can give me some direction/hint?

    Thank you in advance
  2. zooi Customer

    Solved! Not used the accordion but toggle Jquery functionality and Javascript
    See below:

    Code:
    <h3 id="expanderHead" style="cursor:pointer;">
    	<span id="expanderSign">+</span> {$smarty.const.LANG_DIRECT_CONTACT_OWNER}
    </h3>
    <div id="expanderContent" style="display:none">
    <form >
     Your form
    </form>
    <!-- End Contact Form -->
    </div>
    {literal}
    <script type="text/javascript">
    $(document).ready(function(){
    	$("#expanderHead").click(function(){
    		$("#expanderContent").slideToggle();
    		if ($("#expanderSign").text() == "+"){
    			$("#expanderSign").html("−")
    		}
    		else {
    			$("#expanderSign").text("+")
    		}
    	});
    });
    </script>
    {/literal}

Share This Page