English 中文(简体)
我如何创造一种条件,即(a) 湿度超过吉克里的一个要素?
原标题:How do I create an if () mouse is over an element in Jquery?

我有一些 h。 JS Code:

$(  .leftMenuProductWrapper ).hover (
            function () {



            },
            function () {


    });

在第二项职能中,我需要:

If ($("#leftMenuWrapper2").hasMouseover){
do this
}else{
do that};

我无法找到任何关于如何这样做的文件。

http://www.un.org。

这似乎是一种解决办法:

$( #leftMenuWrapper2 ).mouseenter(function(){
    mouseover = true;
}).mouseleave(function(){
    mouseover = false;
});

随后在法典中提到了:

if(mouseover == false){
                doSomething
                };
最佳回答

在非常高级别,你想要的是:

  • Hold a Boolean value.
  • When the mouse triggers a MouseOver event, set the Boolean to true.
  • When the mouse triggers a MouseOut event, set the Boolean to false.

你们必须做的是,将“蓝宝”价值退回到<条码>。

问题回答

我并不完全相信你会做些什么,而是看着你从错误的角度来看待这个问题。

I m 假设你在内有多个要素:leftMenuproductWrapper,其中之一是#leftMenuWrapper2。 我假定你所关心的内容是<代码><div>(但如不成,你可以编辑该代码)。 类似情况:

$( .leftMenuProductWrapper>div ).hover(function(ev) {
    if ($(this).id ==  leftMenuWrapper2 ) {
        // do something with this one
    } else {
        // otherwise, do something else
    }
});




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签