/** * @file * A JavaScript file for the theme. * * In order for this JavaScript to be loaded on pages, see the instructions in * the README.txt next to this file. */ // JavaScript should be made compatible with libraries other than jQuery by // wrapping it with an "anonymous closure". See: // - https://drupal.org/node/1446420 // - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth (function ($, Drupal, window, document, undefined) { //version contact3.js // To understand behaviors, see https://drupal.org/node/756722#behaviors Drupal.behaviors.my_contact_behavior = { attach: function(context, settings) { var $swich= true; if($(".page-node-96").length > 0){ //cambiar el img como background var $bk= $('.node-96 .field-name-field-image-page .field-items .field-item img').attr("src"); $('.node-96 .field-name-field-image-page .field-items .field-item').find('img').remove(); $('.node-96 .field-name-field-image-page').css('background-image', 'url("' + $bk + '")'); //cambiar la posicion de los elementos var $html= $("#block-webform-client-block-101").html(); $("#block-webform-client-block-101").remove(); $(".node-96 .field-name-body .field-items").append($html); //anexar el placeholder $('.webform-client-form .form-item').each(function() { var $placeholder=$(this).find('label').html(); //data = str.replace(/&/, "&"); $(this).find('input, textarea').attr('placeholder', $placeholder); $('#edit-mollom-captcha').removeAttr('placeholder'); }); cambio_rs(); //aplicar cambio de select. $(".webform-client-form .webform-component-select").jqTransform(); function cambio_rs(){ if (($(window).width()<992) && ($swich)){ $cambio=$(".page-node-96 #page #main #content .node-96 .field-name-body .field-items .field-item").html(); $(".page-node-96 #page #main #content .node-96 .field-name-body .field-items .field-item").remove(); $(".page-node-96 .webform-client-form").after('
'+$cambio+'
'); $swich= false; } } $(window).bind('resize', cambio_rs); } }//cierro attach }; })(jQuery, Drupal, this, this.document);