Web Design Forum: Quick Jquery help required - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Quick Jquery help required Trying to rehide a shown element

#1 User is offline   jpwd 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 12
  • Joined: 21-January 12
  • Reputation: 0

Posted 21 January 2012 - 03:43 PM

Hello, I'm new to jquery and want to get a basic working example onto a website I have made. Heres's the website and page in question-beauty-gems. Using a beginners tutorial I have made a basic drop down from the Click More Information tag. However I would like the information shown to be hidden again when the user clicks anywhere on the page. I have tried a few things but to no avail! Thanks.

This post has been edited by jpwd: 21 January 2012 - 03:44 PM

0

#2 User is offline   jonnyhocks 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 85
  • Joined: 04-February 11
  • Reputation: 4
  • Gender:Male
  • Location:South Wales
  • Experience:Intermediate
  • Area of Expertise:I'm Learning

Posted 21 January 2012 - 06:35 PM

View Postjpwd, on 21 January 2012 - 03:43 PM, said:

Hello, I'm new to jquery and want to get a basic working example onto a website I have made. Heres's the website and page in question-beauty-gems. Using a beginners tutorial I have made a basic drop down from the Click More Information tag. However I would like the information shown to be hidden again when the user clicks anywhere on the page. I have tried a few things but to no avail! Thanks.


Not entirely what you want, but I think this is better in my opinion.

Just change .slideDown to .slideToggle and then maybe add a +/- to the link. This will show and hide for you.
0

#3 User is online   Renaissance-Design 

  • Available for custom WordPress work
  • View blog
  • Group: Moderators
  • Posts: 3,595
  • Joined: 12-August 10
  • Reputation: 559
  • Gender:Male
  • Location:South Wales
  • Experience:Web Guru
  • Area of Expertise:Designer/Coder

Posted 21 January 2012 - 07:03 PM

You could attach a click event to the rest of the page with the not() selector.
0

#4 User is offline   jpwd 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 12
  • Joined: 21-January 12
  • Reputation: 0

Posted 21 January 2012 - 07:56 PM

View Postjonnyhocks, on 21 January 2012 - 06:35 PM, said:

Not entirely what you want, but I think this is better in my opinion.

Just change .slideDown to .slideToggle and then maybe add a +/- to the link. This will show and hide for you.


Funnily enough I have just seen this method on W3Schools, I think I will implement it for the time being, with alternate arrows to show the information and the hide the information. Thank you very much.

How would I go about coding the click not()selector? As I think long term that would be the best option.

I'm doing this the wrong way really, implementing code before learning it!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users