Hi saiful!

You have several syntax errors in your code, but I assume they're just
typos (for once, you have "isPopUp" in your one selector, instead of
"#isPopUp").

Your problem likely stems from misinterpreting the mouseout event,
though. That event fires *every time the cursor leaves a child of the
element that's listening to the event*. So, since you have some <a>
elements in your #isPopUp element, the event will fire as soon as you
mouseout of any of the <a>s.

You probably want to use *mouseleave* instead.

Here's code that works, even with the typos ironed out. ;)


<html>
        <head>
                <title>mouseout problem</title>
                <script type="text/javascript" src="jquery.js"></script>
        </head>
        <body>
                <script type="text/javascript">
                        $(document).ready(
                                function() {
                                        $("#text_span")
                                                .mouseover(
                                                        function () {
                                                                
$("#isPopUp").show("slow");
                                                        }
                                                );
                                        $("#isPopUp")
                                                .bind(
                                                        "mouseleave",
                                                        function () {
                                                                
$("#isPopUp").hide("slow");
                                                        }
                                                );
                                }
                        );
                </script>
                <div id="isPopUp" style="display:none">
                        <div><img src="some source"></div>
                        <div>
                                <a href="a">one</a><br>
                                <a href="a">two</a><br>
                                <a href="a">tree</a><br>
                                <a href="a">four</a><br>
                        </div>
                </div>
                <span id="text_span">show the div</span>
        </body>
</html>




On Jan 7, 6:10 am, "saiful.ha...@gmail.com" <saiful.ha...@gmail.com>
wrote:
> hi all,
>
> i has a litle problem when using $(IdElement).shie("slow"); this my
> code
>
> my JQuery
> $(document).ready(function() {
> $("#text_span").mouseover(function(){ $("isPopUp").show("slow");});
> $("#isPopUp").mouseover(function(){$("#isPopUp").css("display",
> "block");});
> $("#isPopUp").mouseout(function(){$("#isPopUp").hide("slow");});
>
> }
>
> My HTML
>
> <div id="isPopUp" style="display:none">
> <div><img src="some source"></div>
> <div>
> <a href="a">one</a><br>
> <a href="a">two</a><br>
> <a href="a">tree</a><br>
> <a href="a">four</a><br>
> </div>
> </div>
>
> <span id="text_span">show the div</div>
>
> when my cursor over in text_span, the div showed and that is true.
> But, the problem when my cursor over the image the div just gone, hide
> with slow.
>
> Where is my incorrect sintax?
>
> When i change the hide("slow") to hide() only, all be fine :(
>
> thang's for help

Reply via email to