Forums

Call button click event from code (3 posts)

  1. Mitja Bonca
    Member
    Posted 3 months ago #

    I have a drop down menu (its from some template). Now I would like to drop it down by the code. It will be a linkable text, and when user will click on it, the drop down menu will open.

    This is the code I have in:
    1. IN Header.php:

    <?php if(get_option('droppanel')!="disable") { ?>
    
                    <div class="trigger">
    
    					<?php if(isset($_POST['TopFirstsubmitted']) || isset($_POST['TopSecondsubmitted']) || isset($_POST['TopThirdsubmitted']) || isset($_POST['TopFourthsubmitted'])) { ?> 
    
                        <a id="open" style="display: none;" class="toggle open" href="#"><img src="<?php bloginfo('template_url'); ?>/images/blank.gif" width="15" height="10" alt="open panel" /></a>
    
                        <a id="close" class="toggle close" href="#"><img src="<?php bloginfo('template_url'); ?>/images/blank.gif" width="15" height="10" alt="close panel" /></a>
    
                        <?php } else { ?>
    
                        <a id="open" class="toggle open" href="#"><img src="<?php bloginfo('template_url'); ?>/images/blank.gif" width="15" height="10" alt="open panel" /></a>
    
                        <a id="close" style="display: none;" class="toggle close" href="#"><img src="<?php bloginfo('template_url'); ?>/images/blank.gif" width="15" height="10" alt="close panel" /></a>
    
                        <?php } ?>
    
                    </div><!-- /trigger -->

    2. AND THIS IS THE CODE FROM JavaScript:

    // Expand Panel
    
    	$("#open").click(function(){
    
    		$("div#panel").animate({height: "show"}, 900, "easeInOutCubic");
    
    	});	
    
    	$(".contacttrigger").click(function(){
    
    		$("div#panel").animate({height: "show"}, 900, "easeInOutCubic");
    
    		$("#toggle a.toggle").toggle();
    
    	});	
    
    	$(".droppaneltrigger").click(function(){
    
    		$("div#panel").animate({height: "show"}, 900, "easeInOutCubic");
    
    		$("#toggle a.toggle").toggle();
    
    	});

    Can anyone help me out, how to create a piece of code that will drop down this dropDown menu from code (on some text click).

  2. Mitja Bonca
    Member
    Posted 3 months ago #

    I tried with something like:
    <p>Click <a id="open" class="toggle open" href="#">here</a> to open it.</p>

    But its not working.
    Any ideas?

  3. Mitja Bonca
    Member
    Posted 3 months ago #

    Can anyone help me out? Please...

Reply

You must log in to post.

About this Topic