Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <div id="feedback">
  2. <div id="feedback_slide">Feedback</div>
  3. <div id="contents">
  4. content here
  5. </div>
  6. </div>
  7.  
  8. $(document).ready(function() {
  9. $('#feedback').click(function(){
  10. $(this).stop().animate({ bottom: 0 }, 350);
  11. });
  12.  
  13. //change 'feedback' to 'close'
  14.  
  15. $('#feedback_slide').click(function(){
  16. $('#feedback').stop().animate({ bottom: -280 }, 350);
  17. });
  18. });
  19.  
  20. $(document).ready(function() {
  21. $('#feedback').click(function(){
  22. $(this).toggleClass("open");
  23. });
  24. });
  25.  
  26. #feedback {
  27. position: fixed;
  28. bottom: -280px;
  29. width: 400px;
  30. height: 300px;
  31. background-color: #eee;
  32.  
  33. -webkit-transition-duration: 0.35s;
  34. -moz-transition-duration: 0.35s;
  35. -ms-transition-duration: 0.35s;
  36. -o-transition-duration: 0.35s;
  37. transition-duration: 0.35s;
  38. }
  39.  
  40. #feedback.open
  41. {
  42. bottom: 0px;
  43. }
  44.  
  45. $(this).html(($(this).parent("#feedback").hasClass("open") ? "Feedback" : "Close")).parent("#feedback").toggleClass("open");
  46.  
  47. $(this).html(
  48. ($(this).parent("#feedback").hasClass("open") ? "Feedback" : "Close")
  49. ).parent("#feedback").toggleClass("open");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement