Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

how can i give delay on "onMouseout"?

Community Beginner ,
Apr 03, 2017 Apr 03, 2017

sorry for bad english first.

<div id="1234">

     <font id="top_shop">

          <a href="www.test.com">

              <img

               src="/images/Test.gif"

               onMouseover="this.src='/images/Test_on.gif';"

               onMouseout="this.src='/images/Test.gif';" />

          </a>

     </font>

</div>

if i wrote codes like that, can i give delay onMouseover? (like if i over my mouse,

i ask this because when i use drop-down menu by use script which right bottom, images are disappear immediately when mouseover.

$("#1234").each(function(index) {

    $(this).mouseover(function() {

        $("#top_shop").css("display", "inline");

    });

    $(this).mouseout(function() {

        $("#top_shop").css("display", "none");

    });

});

its hard explain this problem on english. i will add video bottom. the drop-down menus are disappear for a 0.0001 seconds when mouse over

i think if i give delay on onMouseover, this would be solved. or load images before mouse over work

btw why is this happened?

1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 03, 2017 Apr 03, 2017

You cannot give a delay to any mouse action itself, as these are OS set. What you can do is give a delay to the action that the mouse is to perform, e.g.

delay an image showing on mouse over.

This would if i am reading your post correctly, not solve your problem. If you are using images to display your drop-down menu, then the problem is most likely to be that you have not pre-loaded the images and the image loading time is what is causing the initial delay.

in your example i can see no reason to u

...
Translate
LEGEND ,
Apr 03, 2017 Apr 03, 2017

You cannot give a delay to any mouse action itself, as these are OS set. What you can do is give a delay to the action that the mouse is to perform, e.g.

delay an image showing on mouse over.

This would if i am reading your post correctly, not solve your problem. If you are using images to display your drop-down menu, then the problem is most likely to be that you have not pre-loaded the images and the image loading time is what is causing the initial delay.

in your example i can see no reason to use an image as it is all text. But if images are necessary then an image preloader may solve the problem. With the increased usage of mobile devices, images for menu items are being used less and less, due to bandwidth considerations. If you do think that images are necessary then i would recommend using an image pre-loader.

If you google the subject, then you should find hundreds of examples to help you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 03, 2017 Apr 03, 2017

i know fill my homepage with image isn't a good idea. but the host(?) doesn't support customize font

also i'm working on mobile page. because i know that it's better use less image on mobile.

i'm gonna google about image loader.

thank you for support and help . have a good day

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2017 Apr 04, 2017
LATEST

Mobile users don't have a mouse.  They must use their finger to tap the screen.  OnClick is a better option. And it stays open until the user clicks something.

See this link for details.

Re: Drop Down Menus in CC

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines