Hi Pops, Thank you for your reply and quick scan.
Yeah, I knew I had to explain what was actually happening that wasn't right, but I had a bit of trouble finding the right words ;-) What I was really saying with 'acting weird':. Let's say you have 3 list items and you click the first one, it opens the way it should (fade in). Clicking again closes the item as it should (fade out). You can repeat it over and over and it performs right. BUT, if you click for instance the second item (which also opens/closes as it should) and you click the first one again, instead of fading in it appears instantly, then flickers and does the fade in. Clicking doesn't fade it out, it does the same thing over and over. Basically you're ok clicking items you haven't opened yet, they all work properly, but click one you already have clicked, it does this. I've tested your code also, but it does the same this as described. Also, it looks as if your code doesn't like onclick AND onfocus. But this may be something I did wrong though ;-) Gonna try and tweak your code, see where it takes me. Thanks!! Gavin On Aug 21, 5:51 pm, Pops <[EMAIL PROTECTED]> wrote: > Codex, > > I played with your code and this is what I found: > > Yes, It acted "wierd!" <g> > > First, I think that was because of the onFocus= on the <a> tag link > which will fool with your mind depending on where is the current > keyboard focus including switching browser pages. :-). > > Changing it to OnClick= begins to bring sanity to getting it worked > out. > > Second, the toggle was being acted on the #mail_code id rather than > the #prep-mail_code. If that is some cool trick you were thinking of, > it certainly confused the hell out of mail > > Anyway, after that I changed you readmail() function to: > > function readmail (mail_code) { > var $p = $('#prep-'+ mail_code); > if ($p.is(":hidden")) { > // Its hidden so toggled it on and do a AJAX call > $p.toggle(); > $.post("/jquery-fake-mail.wct", > {}, > function(response){ > // Hide the spinner > $("#spinner-"+ mail_code).fadeOut(500); > // Populate the prepared p-element with the response > $("#prep-"+ mail_code).html(response).fadeIn(500); > } > ); > } else { > // Its showing so slowly fade away and hide it > $("#prep-"+ mail_code).fadeOut(500); > } > return false; > > }; > > it was a thing of beauty! <g> > > Note, the .post() command. I have my fake url there so I can dump > text for this testing . Put back your URL there and it should work. > > Finally, if you really wanted the onfocus, you can now better begin to > explore that to auto-turn off stuff. But I would pay attention to > window switching issues there. :-) > > -- > HLS > > On Aug 21, 10:13 am, Pops <[EMAIL PROTECTED]> wrote: > > > On Aug 20, 4:50 pm, Codex <[EMAIL PROTECTED]> wrote: > > > > It's sort of working, but the toggle seems to be acting weird. Can > > > someone please go over the code and tell me what I might be doing > > > wrong? > > > A quick scan appears to be logical. > > > What's wrong? Describe "Acting Wierd." By not being specific, it > > forces people who may be interested in helping to actually spent more > > time to prepare a test bed to see what you see as "wield." > > > A good development tip as well as tip when seeking public help: > > > Try to reduce your code to a "plain vanilla" example where there are > > no other dependencies, thus using divide and conquer" techniques by > > separating the functional parts. You reduce the amount of people who > > can help when posting highly specific code. You never know. You might > > even find the problem by dividing and conquering each part. I know it > > does for me, atleast 99% of the time. :-) > > > -- > > HLS