Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
How to make sure that click event happens when tab finish loading

Using inline javascript I am trying to scroll to a section after loading a particular tab.

setTimeout(function(){
    $(".multimediaList a").click(function(event){
       // loads tab 
        $("li#abc").click();
       // trigger scrolling to a section and open a popup
        var sectionId = event.target.getAttribute("data-sectionId");
        var sectionImageId = event.target.getAttribute("data-sectionImageId");
        setTimeout(function(){
            TRLSC.SI.aJsClass.loadSection(sectionId, sectionImageId);
        },1000)
    })
})

Here is load section function defined in an js file. We are using angularjs framework

loadSection: function(b, a) {
    $("#DBsection_" + b).addClass("unloaded");
    TRLSC.SI.aJsClass.showDiv(b, a);
    TRLSC.SI.aJsClass.showSection(b);
    $("#DBsection_" + b).removeClass("unloaded");
    $("#DBsection_" + b).show()
},

Here is show div function

showDiv: function(b, a) {
    $("#DBtitle_" + b).parent().addClass("is-expanded");
    $("#DBtitle_" + b).addClass("accordian-holder-titleDBopened");
    $("#icon_" + b).addClass("accordian-holder-indicatorOpened");
    $("#icon_" + b).removeClass("accordian-holder-indicator");
    TRLSC.SI.aJsClass.dbLoadContent(b, a);
    TRLSC.SI.aJsClass.changeText()
},

the issue with this approach is that sometimes dbLoadContent is triggering before the tab has loaded and is not scrolling to the section, also there is no error in the console.

How to make sure that click event happens when tab finish loading!

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!