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

195
Views
Make div disappear when move out of itself (the div) d3.js

I have a div appearing as soon as I click the a rect (bar). At the moment, my div is disappearing as soon as I move out of the rect. But I want to show it until I leave the div. How can I do this?

var div = d3.select('body').append('div')
        .attr('class', 'tooltip-donut')
        .style('opacity', 0);

    rect.enter()
        .insert('rect', ':first-child')
        .on('click', function (d, i) {
            d3.select(this).transition()
                .duration('50')
                .attr('opacity', '.85');
            // Makes the new div appear on hover:
            div.transition()
                .duration(50)
                .style('opacity', 1);
            div.html(['Taskname: ' + i.taskName, 'Start: ' + i.startDate.toLocaleTimeString(), 'Ende: ' + i.endDate.toLocaleTimeString()].join('<br/>'))
                .style('left', (d.pageX) + 'px')
                .style('top', (d.pageY - 15) + 'px');
        })
        .on('mouseout', function (d, i) {
            d3.select(this).transition()
                .duration('50')
                .attr('opacity', '1');
            div.transition()
                .duration('50')
                .style('opacity', 0);
        })
about 4 years ago · Juan Pablo Isaza
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!