Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //open
- var links = $('.enable-contact');
- var modal = $('.contact-form-wrapper');
- var input = $('.contact-form-wrapper').find('.wpcf7-text');
- input.each(function(){
- $(this).attr("autocomplete", "off");
- });
- links.each(function(){
- $(this).click(function(){
- var option = $(this).parents('.order-lg-first').find('.option').val();
- //add value
- modal.addClass('open');
- modal.find('select').val(option);
- return false;
- });
- });
- //close
- var closebtn = $('.close-modal');
- closebtn.click(function(){
- modal.removeClass('open');
- setTimeout(function(){
- modal.find('select').val('');
- }, 600);
- });
- //input focus
- $('.form-group').find('input').focus(function(){
- $(this).parents('.form-group').find('label').addClass('focused');
- }).blur(function(){
- if($(this).val() === ''){
- $(this).parents('.form-group').find('label').removeClass('focused');
- }
- });
- //textarea focus
- $('.form-group').find('textarea').focus(function(){
- $(this).parents('.form-group').find('label').addClass('focused');
- }).blur(function(){
- if($(this).val() === ''){
- $(this).parents('.form-group').find('label').removeClass('focused');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement