Guest User

Untitled

a guest
Mar 18th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. //************
  2. // Чекбокс в Feedback
  3. // **********
  4. $(".field-checkbox").each(function() {
  5. $(this).click(function() {
  6. if ( $(this).find("input").prop('checked') === false) {
  7. $(this).find(".field-checkbox__input-fake").addClass("field-checkbox__input-fake--checked");
  8. $(this).find("input").prop('checked', true);
  9. } else {
  10. $(this).find(".field-checkbox__input-fake").removeClass("field-checkbox__input-fake--checked");
  11. $(this).find("input").prop('checked', false);
  12. }
  13. });
  14. });
  15.  
  16. //************
  17. // Рамка для чекбокса в CF7 при плохой отправке
  18. // **********
  19.  
  20. $('.wpcf7').on('wpcf7mailsent', function(){
  21. // $.fancybox.close();
  22. // $.fancybox.open({
  23. // src : '#done',
  24. // type : 'inline',
  25. // toolbar : false
  26. // });
  27. var checkbox_label = $(this).find(".field-checkbox");
  28. jQuery.each(checkbox_label, function() {
  29. $(this).removeClass("checkbox__checked");
  30. $(this).removeClass("checkbox__not-valid");
  31. });
  32. });
  33. $('.wpcf7').on('wpcf7invalid', function() {
  34. var checkbox_label = $(this).find(".field-checkbox");
  35. jQuery.each(checkbox_label, function() {
  36. if ($(this).children().children(".wpcf7-not-valid").length == true) {
  37. $(this).addClass("checkbox__not-valid");
  38. } else {
  39. $(this).removeClass("checkbox__not-valid");
  40. }
  41. })
  42. });
Add Comment
Please, Sign In to add comment