Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/05/2015, 03:55
Woltio
 
Fecha de Ingreso: mayo-2015
Mensajes: 4
Antigüedad: 8 años, 10 meses
Puntos: 0
Depuración script

Saludos,

tengo un script que imagino que por motivos de orden de sentencias o problemas en la sintaxis no me funciona como debe. ¿Me podriais hacer el favor de depurarlo?
Muchas gracias por vuestro tiempo cracks.

<script>
jQuery(function($){

var $optionSets = $('#options .option-set'),
$optionLinks = $optionSets.find('a');

$optionLinks.click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return false;
}
var $optionSet = $this.parents('.option-set');
$optionSet.find('.selected').removeClass('selected ');
$this.addClass('selected');


var options = {},
key = $optionSet.attr('data-option-key'),
value = $this.attr('data-option-value');

value = value === 'false' ? false : value;
options[ key ] = value;
if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {

changeLayoutMode( $this, options )
} else {
// otherwise, apply new options
$container.isotope( options );
}

return false;
});

var $container = $('#container');
function resize_element(){
var height=$('.element').width();
$('.element').height(height);
}
resize_element();



$container.isotope({
itemSelector : '.element',
animationEngine: 'best-available',
<?php if(ICL_LANGUAGE_CODE==en){ ?>
filter: '.featured',
<?php }else{ ?>
filter: '.destacados',
<?php } ?>
resizable: false, // disable normal resizing
masonry: { columnWidth: $container.width() / 3 }
});
$(window).smartresize(function(){
resize_element();
$container.isotope({
// update columnWidth to a percentage of container width
masonry: { columnWidth: $container.width() / 3 }
});
});

function initialize() {
var divH = $('.proyect-title p').innerHeight()/2;
var pageH = $('.proyect-title').innerHeight()/2;
$('.proyect-title p').css({top: (pageH-divH)});
}

initialize();

$(window).on('resize',function(){
initialize();
});

});

</script>