Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poshytip content overlaps onmouseover function when the content changes based on condition #24

Open
maddan opened this issue Mar 11, 2014 · 1 comment

Comments

@maddan
Copy link

maddan commented Mar 11, 2014

I have a code snippet regarding poshytip plugin issue:
Show tooltip for hover"

var showFav = function(id){

$('.tip-fav').remove();
    var Text= "";
    if($("#"+id).attr("class") == "fi"){
        Text= "ADD FAVORITES";
    }else{
        Text= "REMOVE FAVORITES";
    }
$("#"+id).poshytip('disable').poshytip('enable');
      $(id).poshytip({
        content: 'Text',
        className: 'tip-fav',
        bgImageFrameSize: 9,
        showOn: 'hover',
        delay:0,
        alignX: 'right',
        alignY: 'top'
});
}

HTML/JSP:

if (condition){

<img class="fi" onmouseover="showFav(this.id);" ../>
} else {
<img class="fsi" onmouseover="showFav(this.id);" ../>
} </div>

(*Note the classname changes dynamically. When class=fi, I want to show 'Add' and when class=fsi, i want to show 'Remove')

The problem with is whenever I hover the image. The first time it works and show the content fine (ie 'Add Favorites'). After I click the image and then hover out it shows 'Remove Favorites'.

Now again hover back in, both contents are over lapped with text 'Add Favorties' on top of 'Remove Favorites'. Is there a way to show only one content at a time? I did try to disable and enable but with no luck $("#"+id).poshytip('disable').poshytip('enable');

Is there a way to get rid of this issue?
Thanks.
Much appreciated.

@vadikom
Copy link
Owner

vadikom commented Mar 21, 2014

If possible, please post a complete live demo where the issue can be tested as it's not very simple to figure out the problem just by looking at your short code samples. But it seems likely that this is an issue with your code rather than with Poshytip's code so I would recommend to post your question in the support forum instead:

http://www.smartmenus.org/support/forums/#/categories/poshytip-jquery-plugin

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants