Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

toggle webpage area/DIV visible - not visible

Status
Not open for further replies.

RCinSTP

Programmer
Oct 10, 2012
5
0
0
US
If you look at the webpage in the link below, and you click on the "Reply to this post" button. An area with email reply options becomes visible, when you click the reply button again the reply options disappear. I have searched through the code AND the javascripts but I don't see the function that is toggling the reply button making the reply options visible/not visible. I would post the page code but the code only seems to work when it is live on the CraigsList website, it does not work when I move it to another web server, even though I moved all the javascripts and re-coded the paths to the javascripts. I also tried, moving the htm and recoding the paths for the javascripts to the original Craigslist url. I understand how to do this with Javascript, I can write a javascript to do what the existing javascript is already doing. My question is not how to re-do what is already existing in the example page, my question is: How is this being done on the example page? Is it done with Javascript or jquery? Where is the code that is toggling the email replies making them visible/not visible?

Link
 
As far as I can tell, its using jquery located inside the postings.js file.
Code:
('#returnemail,#reply_button,#replytext').toggle()...


('#reply_options,#reply_button').click(function(e)...

There's a few other places where the reply_button id is used. Since that's the id of the button its safe to assume those actions are connected to it.

In this case the JQuery Toggle method would show or hide a predefined object. Likely that's what they are using.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
How do I mark this posting as resolved?
 
You don't. Its not a feature of this site. [pipe]

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top