contentbox.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. $(document).ready(function(){
  2. /* Box switch toggle */
  3. $('.switch-button').click(function(ev){
  4. ev.preventDefault();
  5. var switchParent = $(this).attr('switch-parent');
  6. var switchTarget = $(this).attr('switch-target');
  7. $(switchParent).slideToggle();
  8. $(switchTarget).slideToggle();
  9. });
  10. /* Content Box Show/Hide Buttons */
  11. $('.hidden-button').hover(function(){
  12. $(".btn-hide", this).fadeIn('fast');
  13. },function(){
  14. $(".btn-hide", this).fadeOut('normal');
  15. });
  16. /* Content Box Toggle */
  17. $('.toggle-button').click(function(ev) {
  18. ev.preventDefault();
  19. $(".glyph-icon", this).toggleClass("icon-rotate-180");
  20. $(this).parents(".content-box:first").find(".content-box-wrapper").slideToggle();
  21. });
  22. /* Content Box Remove */
  23. $('.remove-button').click(function(ev){
  24. ev.preventDefault();
  25. var animationEFFECT = $(this).attr('data-animation');
  26. var animationTARGET = $(this).parents(".content-box:first");
  27. $(animationTARGET).addClass('animated');
  28. $(animationTARGET).addClass(animationEFFECT);
  29. var wait = window.setTimeout( function(){
  30. $(animationTARGET).slideUp()},
  31. 500
  32. );
  33. /* Demo show removed content box */
  34. var wait2 = window.setTimeout( function(){
  35. $(animationTARGET).removeClass(animationEFFECT).fadeIn()},
  36. 2500
  37. );
  38. });
  39. /* Close Info Boxes */
  40. $(function() { "use strict";
  41. $(".infobox-close").click(function(ev){
  42. ev.preventDefault();
  43. $(this).parent().fadeOut();
  44. });
  45. });
  46. });