Completed

Adding a reload condition in a javascript function when blurb activated

Hi Everyone,

In my website and on this page: [login to view URL] i got the following organization:

- a menu composed of blurbs. When one is activated, the other one are disable.

- module displayed for each blurb. Each module displays a grid representation of the articles in my blog. And all the articles displayed have the same height.

Current trouble: if you click on a blurb my function to uniformize the height is not working properly because it's not reloaded. Please, have a try to understand the issue.

So, for this project, no need website access but just to tell me or change my code to make it working.

Code for the activation of the blurb:

<script>

jQuery(document).ready(function($) {

$('.tab-title').each(function () {

var section_id = $(this).find("a").attr("href");

$(this).find("a").removeAttr("href");

$(this).click(function() {

$(this).siblings().removeClass("active-tab");

$(this).addClass("active-tab");

$('.tab-content').hide();

$(section_id).show();

});

});

});</script>

Code to equalize the height of the articles displayed:

<script>

(function ($) {

$(document).ready(function () {

$( window ).resize(function() {

$(".displayarticles").each(function(){

equalise_articles($(this));

});

});

$(".displayarticles").each(function(){

var blog = $(this);

equalise_articles($(this));

var observer = new MutationObserver(function (mutations) {

equalise_articles(blog);

});

var config = { subtree: true, childList: true };

[login to view URL](blog[0], config);

});

function equalise_articles(blog){

var articles = [login to view URL]("article");

var heights = [];

[login to view URL](function(){

var height = 0;

//height += $(this).outerHeight() - $(this).height();

height += $(this).find(".et_pb_image_container").outerHeight(true);

height += $(this).find(".entry-title").outerHeight(true);

height += $(this).find(".post-meta").outerHeight(true);

height += $(this).find(".post-content").outerHeight(true);

[login to view URL](height);

});

var max_height = [login to view URL](Math,heights);

[login to view URL](function(){

$(this).height(max_height);

});

}

$(document).ajaxComplete(function(){

$(".displayarticles").imagesLoaded().then(function(){

[login to view URL]("images loaded");

$(".displayarticles").each(function(){

equalise_articles($(this));

});

});

});

$.[login to view URL] = function () {

var $imgs = [login to view URL]('img[src!=""]');

if (!$[login to view URL]) {return $.Deferred().resolve().promise();}

var dfds = [];

$[login to view URL](function(){

var dfd = $.Deferred();

[login to view URL](dfd);

var img = new Image();

[login to view URL] = function(){[login to view URL]();}

[login to view URL] = function(){[login to view URL]();}

[login to view URL] = [login to view URL];

});

return $.[login to view URL]($,dfds);

}

});

})(jQuery);

</script>

In this 2nd code, i think we should add a reload condition to resize well the articles...but i don't find how to do so.

In advance, thank you!

Skills: JavaScript, PHP, HTML, CSS, jQuery / Prototype

See more: Javascript function, joomla main_menu javascript function, format javascript function line, calling javascript function backend cnet web application, set homepage javascript function, javascript function stm, write javascript function mysql query, convert javascript function, dropdownlist javascript function database, simple isnumeric javascript function, javascript function richtextbox, onmouseover javascript function enlarge image, adding options thru javascript w3c validation, view form condition javascript, javascript function calculate due date, metatrader javascript function, call javascript function img html tag

About the Employer:
( 11 reviews ) Thonon-les-bains, France

Project ID: #26815689

Awarded to:

IYVaziri

Hello, Thanks for the invite do you want me to just modify the code that work's or need that actually fixed on the site? I guess access details still working? Will check this soon and update by tomorrow. Regards, More

€30 EUR in 7 days
(8 Reviews)
3.3

9 freelancers are bidding on average €21 for this job

(293 Reviews)
6.9
justTry

Salut! The requested code modification is ready and I can forward it as soon as you move forward with the project. Bien Cordialement, Dobri

€15 EUR in 0 days
(184 Reviews)
6.2
vovapod

Hello there. Nice to meet you. Could you send all details? I am experienced in PHP, JavaScript (full stack). I have a lot of experience in Javascript, jQuery, HTML5, CSS, Joomla, Prestashop, Opencart, Drupal, React.js More

€20 EUR in 7 days
(31 Reviews)
4.8
fahadahmed09

I can complete your project on time and within your budget. I have worked on similar projects to what you are looking for, and I am confident I can exceed your expectations. I would love to work on your project. I view More

€25 EUR in 1 day
(11 Reviews)
3.7
dremovayulya1

Hi. Your project seems to fit me. As a newcomer, I am looking for a small project I can get to work. For me, budget is not important, only good review for my career! I have much experience in JS, PHP, Python and their More

€8 EUR in 1 day
(9 Reviews)
2.9
nemanja1029

Hello. I have many experience about the PHP, MySQL, Javascript, Jquery, Ajax, HTML, CSS, Bootstrap and PHP framework (Code igniter, Laravel, Yii2, Word press, Moodle). And i can design and manage the mysql database an More

€15 EUR in 7 days
(4 Reviews)
1.8
izharfida77

Hello sir i can do this as per your requirements. I am izhar ali fida web developer with more than 3 years [login to view URL] area of my expertise are html,css, bootstrap, javascript, jquery,ajax,PHP and Laravel. I am look More

€15 EUR in 2 days
(2 Reviews)
0.0
HamzaZahid5

Hi I have more than 5 years experience in Python, Rest API , Selenium, Data Science , Web scraping, X-path, JavaScript, Database (SQL), Html 5, CSS, PHP(La ravel), Excel, Google Sheet, Data Entry, Software Engineering More

€30 EUR in 1 day
(1 Review)
0.0