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

263
Views
How can I change a resizable elements title on resize

I have a resizable li element in an ol in a div. The resizable is working and the element can be resized. I'm using the elements height to provide feedback on what the height will be when the item is released (16px is 15minutes). However the elements title is not adjusted and so no feedback is provided.

My html:

<div class="day">
    <ol id="t2022-02-26" style="height: 100%;width: 100%;" class="jobs job-todo" data-date="2022-02-21">
        <li class="task" style="height: 256px; width: 225px;" title="4h00m" data-task="14">
            <span class="task-head">Example1</span>
            <div class="description">
                <p>This is resizable</p>
            </div>
        </li>
    </ol>
</div>

and the associated javascript:

$( function() {
    $(".task").resizable(
        {
            // containment: "parent",
            distance: 8,
            ghost: true,
            handles: "n",
            grid: 16,
            resize: function( event, ui ) {
                var h = ui.helper.css( "height" );
                h = h.slice( 0, -2 ); // remove the px
                var height = h / 64 ; // as a decimal
                var hours = Math.trunc( height );
                var mins = (height % hours) * 60;
                var result = hours + "h" + mins + "m";
                console.debug( "(" + height + "hours.) hours: " + hours + ", mins: " + mins );
                ui.helper.title = result;
            }
        }
    );

With this code the change is echoed into the debug colsole but the title of the element is unchanged and the tooltip is thus unchanged!

thanks

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!