Corregir jquery/javascript wordpress
Budget: $30 – $250 USD
Necesito corregir un mal funcionamiento de un js perteneciente a un tema de WordPress.
Al hacer click en la imagen debe desplegarse debajo el contenido sin modificar el layout de arriba (ver imágenes ilustrativas).
Esta es la función del tema:
$('.portfolio-item').click(function(){
var elementsIndex = $(this).index('.portfolio-item'); //elements current index
elementsLength = elements.length; // total amount of elements
elementsInRow = lisInRow; //amount of elements in a row
elementsRow = Math.floor(elementsIndex/elementsInRow)+1;
elementsOffset = $(this).offset().top + 180; //top position of element clicked (130 was added so only the title of thumbal shows not including the image)
contentURL = $(this).attr("data-url"); //get data content id
currentWrapPos = (elementsRow * elementsInRow) - 1; //slidedown content wrapper position
arrowPosition = $(this).position().left + $(this).width() / 2 - 12;
currentIndexHeight = $('.portfolio-item-content').height();
//add remove selected class
elements.removeClass('activeItem');
$(this).addClass('activeItem');
//slidedown content wrapper
if(currentWrapPos == startingWrapPos){
$('.portfolio-item-arrow').animate({"left": arrowPosition+'px'}, 300);
}else{
startingWrapPos = currentWrapPos;
elements.removeClass('lastInRow');
$(elements[currentWrapPos]).addClass('lastInRow');
$('.portfolio-item-wrap').slideUp( function() { $(this).remove(); });
$('.lastInRow').after('<div class="portfolio-item-wrap clearfix"><span class="portfolio-item-arrow" style="left:'+arrowPosition+'px"><i class="fa fa-caret-down"></i></span><span class="portfolio-item-close"><i class="fa fa-times"></i></span><span class="portfolio-item-next"><i class="fa fa-angle-right"></i></span><span class="portfolio-item-prev"><i class="fa fa-angle-left"></i></span><div class="portfolio-item-content"><img src="images/AjaxLoader.gif" class="Loader"></div></div>');
$('.portfolio-item-wrap').slideDown();
}
//console.log(startingWrapPos, currentWrapPos);
//empty featContent and then append correct content based off data attribute
$('.portfolio-item-content').empty();
$(".portfolio-item-content").load(contentURL).show();
$("Loader").hide();
el tema es Heylone
Al hacer click en la imagen debe desplegarse debajo el contenido sin modificar el layout de arriba (ver imágenes ilustrativas).
Esta es la función del tema:
$('.portfolio-item').click(function(){
var elementsIndex = $(this).index('.portfolio-item'); //elements current index
elementsLength = elements.length; // total amount of elements
elementsInRow = lisInRow; //amount of elements in a row
elementsRow = Math.floor(elementsIndex/elementsInRow)+1;
elementsOffset = $(this).offset().top + 180; //top position of element clicked (130 was added so only the title of thumbal shows not including the image)
contentURL = $(this).attr("data-url"); //get data content id
currentWrapPos = (elementsRow * elementsInRow) - 1; //slidedown content wrapper position
arrowPosition = $(this).position().left + $(this).width() / 2 - 12;
currentIndexHeight = $('.portfolio-item-content').height();
//add remove selected class
elements.removeClass('activeItem');
$(this).addClass('activeItem');
//slidedown content wrapper
if(currentWrapPos == startingWrapPos){
$('.portfolio-item-arrow').animate({"left": arrowPosition+'px'}, 300);
}else{
startingWrapPos = currentWrapPos;
elements.removeClass('lastInRow');
$(elements[currentWrapPos]).addClass('lastInRow');
$('.portfolio-item-wrap').slideUp( function() { $(this).remove(); });
$('.lastInRow').after('<div class="portfolio-item-wrap clearfix"><span class="portfolio-item-arrow" style="left:'+arrowPosition+'px"><i class="fa fa-caret-down"></i></span><span class="portfolio-item-close"><i class="fa fa-times"></i></span><span class="portfolio-item-next"><i class="fa fa-angle-right"></i></span><span class="portfolio-item-prev"><i class="fa fa-angle-left"></i></span><div class="portfolio-item-content"><img src="images/AjaxLoader.gif" class="Loader"></div></div>');
$('.portfolio-item-wrap').slideDown();
}
//console.log(startingWrapPos, currentWrapPos);
//empty featContent and then append correct content based off data attribute
$('.portfolio-item-content').empty();
$(".portfolio-item-content").load(contentURL).show();
$("Loader").hide();
el tema es Heylone