Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1705 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Need jQuery help

Thread title: Need jQuery help
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
08-24-2008, 10:25 AM
#1
dicetomato is offline dicetomato
Status: Member
Join date: Jan 2006
Location: Orange County, CA
Expertise:
Software:
 
Posts: 117
iTrader: 0 / 0%
 

dicetomato is on a distinguished road

  Old  Need jQuery help

Hello, having some problem with javascription.

What I'm trying to accomplish is:

1. on default, div#options-dropdown is hidden.
2. When user clicks on div#options, #options-dropdown shows up.
3. After that, when a user clicks on any part of the browser other than #options-dropdown, the #options-dropdown hides.

Here is the code:

Code:
$(document).ready(function() { 
	$(document).click(function(event) {
		$("#options-dropdown").hide();
		if ((event.target == $('#options-dropdown')) && (event.target == $('#options'))) {
			$("#options-dropdown").show();
		} 
	});	
});
Thanks in advance!

     


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed