Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8207875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:08:38+00:00 2026-06-07T09:08:38+00:00

I am tring to make a hover function, which on hover, unbinds a previous

  • 0

I am tring to make a hover function, which on hover, unbinds a previous binded function.

But I don’t think I understand what the jquery website is trying to explain.

Please see my attempt in this jsfiddle. http://jsfiddle.net/motocomdigital/S9uVh/

This is my binded function which runs fine…

$("h1.trunc").bind().shorten({
    width: 300,
    tail: '...',
    tooltip: false 
});

But I am then trying to .unbind() it when my element is hovered, but the re-bind it on my second hover alternation…

$('#element').hover(
    function () {

        $(this).find("h1.trunc").unbind();

        $(this).animate({
            height : '100px'    
        }, 200 );       

    }, 
    function () {

        $(this).find("h1.trunc").bind().shorten({
            width: 300,
            tail: '...',
            tooltip: false
        });

        $(this).animate({
            height : '20px'    
        }, 200 );

    }
);​

Can someone help me fix this please. Also is there a way of not having to re-write the entire “h1.trunc” function again inside my hover function.

Please see working jsfiddle here. Thanks in advance.

http://jsfiddle.net/motocomdigital/S9uVh/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:08:40+00:00Added an answer on June 7, 2026 at 9:08 am

    If you look at what shorten is actually doing, it is removing the text and there is no reverse of this method e.g. unshorten.

    If I understand correctly, you are wanting to display the text when hovering, then truncating it again on hoveroff.

    I would get rid of the shorten plugin, and just use css. Check out this little fiddle: http://jsfiddle.net/S9uVh/22/

    Basically I am just removing a class, then adding it again. The <h1> tag is shorted using;

    text-overflow: ellipsis;
    overflow: hidden;    
    white-space: nowrap;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a jQuery image overlay on div hover function, but I'm
I'm trying to make a basic hover on a ul element, which would display
I'm trying to make a default hover effect for all my inline menus but
I'm trying to make a simple navigation menu with jquery, where you hover over
I'm trying to make a simple JQuery button from a div which will change
I'm trying to make an accordion-like menu with jQuery, but it refuses to cooperate:
I am new to jQuery and I am trying to make a hover effect
I am currently trying to make some jQuery hover effects render correctly in all
im trying to make a border to a image when i Hover it but
I'm trying to make hover effect which will change height of li (list) element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.