user1086348
user1086348

Reputation: 81

making hover over text toggle with jQuery

I'm trying to make some text I have as an attribute of an element toggle up when the cursor is hovering. Currently, I'm seeing weird things happening with this code, but feel like I'm very close...any ideas?

$(".hoverDes").mousemove(function(){
    $(".hoverDes").toggle(function(e){
        var hoverIt = $(this).attr("hoverDesDiv");
        $("#hoverDiv").text(hoverIt).show();
        $("#hoverDiv").css("top", e.clientY-30).css("left", e.clientX-50);
    }).mouseout(function(){
        $("#hoverDiv").hide();
    })
});

Upvotes: 0

Views: 300

Answers (2)

mindandmedia
mindandmedia

Reputation: 6825

something like this?

  hoverIt.show('slide', {direction: 'right'}, 500);

Upvotes: 1

The Alpha
The Alpha

Reputation: 146201

Your question is not clear enough to me but from your code above I guess you need this

$(".hoverDes").hover(function(e){
    var hoverIt = $(this).attr("hoverDesDiv");
    $("#hoverDiv").text(hoverIt).show('slow');  
},
function(e){
    $("#hoverDiv").hide('slow');
});

Upvotes: 1

Related Questions