簡體   English   中英

使用jQuery將鼠標懸停在文本切換上

[英]making hover over text toggle with jQuery

我正在嘗試將鼠標懸停時使作為元素屬性的一些文本切換為向上。 目前,我看到這段代碼發生了奇怪的事情,但是感覺我已經很接近了……有什么想法嗎?

$(".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();
    })
});

您的問題對我來說還不夠清楚,但是從上面的代碼中,我想您需要這個

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

這樣的東西?

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM