...

View Full Version : Drop down menu with title image change



thomaslo
11-18-2011, 01:23 PM
Hi,

I have very little knowledge in coding,
recently I found 2 scripts, (this is only part of the code for each one)

one creates a Dropmenu with Jquery (slidedown)

<script type="text/javascript" src="http://static.tumblr.com/3ikgvxs/0TGl4zgpu/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".links_body").hide();
$(".links_head").click(function(){
$(this).next(".links_body").slideToggle('fast');
}); }); </script>


Other one lets me change the header image as I click it (opens menu) and return to the original image when I click it the 2nd time (close menu). But this one doesn't slide out, it just appears.

function showhide(layer_ref,imgobj,src1,src2) {
var hza = document.getElementById(layer_ref);
var state=hza.style.display!='block';
hza.style.display = state?'block':'none';
imgobj.src=state?src2:src1;

I want to know if it is possible to combine the two, so i can have a slide open drop down menu with the head image that changes when i click it, and returns to original when i click it the 2nd time?

Any help would be greatly appreciated, Thank You!

Frankie
11-18-2011, 03:08 PM
so i can have a slide open drop down menu with the head image that changes when i click it, and returns to original when i click it the 2nd time?
If nobody responds here, I would suggest to make a drawing, on paper and scanned or in a graphics program, prepare to upload it and re-post your question in Web projects (http://www.codingforums.com/forumdisplay.php?f=56).

alykins
11-18-2011, 03:13 PM
very possible and should be easy- ask to move to javascript forum or post in there if no one moves it- but essentially what you want to do is have an accordion menu that toggle-swaps images for the "title"/"menu"/"whatever" region... you could do either a simple call to the accordion at the end of the toggle (or beginning) function or you could do a multi call with your onclick.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum