开发者

Facebook style comment box using jQuery

i was working on a facebook like website.and im really impressed with the facebook's commentbox.the toggle stuff are really awesome.can someone help me get something like that. please dont send me this link http://demos.9lessons.info/multislide.php this is the most famous link on internet but i dont think it is like facebook from any point of view.please开发者_如何学Go i need some serious help !!!!!!!


Well you already know the answer, no not the link you pasted, what you tagged your question with:

jQuery

You need to use AJAX via jQuery and modify a with CSS to get exactly what you want. You're coding in PHP so get use to the idea of making your own web controls by hand, it's very easy.


I doubt you're going to find anybody that'll write the code for you, and from the sound of it, you have done your homework and shopped around at the various script sites. What I would suggest is to break down the behavior of what you're looking for and what you have:

Facebook:

  • Simple link: "Comment"
  • Thin text box: "Write a comment"
  • Clicking link creates div under link or setting focus to text box transforms text box into textarea and button.
  • Clicking outside of div removes div from page.
  • When button is pushed and comment is made, a div is added between the original div and the link containing the text of the comment.
  • When textarea does not have focus, it returns the textarea back to its original state as a text box.

Perhaps it would be best to take the code already written for the link you posted and do these things to it:

  1. Remove transitions
  2. Change button elements into <a> tags
  3. Make the "slider" box visible all the time, but have the contents shift
    • The box should have an <input type="text"> in it with an onfocus="" attribute set so that we can hide it and show the textarea when it's been clicked in
    • The textarea and button should be hidden until instructed to become visible (display:none)
  4. Use a jQuery plugin to hide the textarea and button and revert to the text box when the comment div has lost its focus(es).

Hope this helps to some degree.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜