Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6741019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:40:32+00:00 2026-05-26T11:40:32+00:00

I am unsure why this script is not working as it should I think

  • 0

I am unsure why this script is not working as it should I think and when I run it no errors happen. I am also running qTip 2 if that makes any difference as to how this script interacts.

Here are my scripts.

JS

    <script type="text/javascript">
var $j = jQuery.noConflict();

var growlSound = $j("#growlSound")[0];
$j("#growl")
    .mouseenter(function() {
            growlSound.play();
    });

var laughSound = $j("#laughSound")[0];
$j("#laugh")
    .mouseenter(function() {
            laughSound.play();
    });

</script>

HTML

<audio id="growlSound" preload="auto">
                            <source src="/messages4u/2011/images/october/growl.ogg">
                            <source src="/messages4u/2011/images/october/growl.mp3">
                            Your browser does not support HTML5 Audio. Please Upgrade Your Browser.
                    </audio>
                            <audio id="laughSound" preload="auto">
                            <source src="/messages4u/2011/images/october/laugh.ogg">
                            <source src="/messages4u/2011/images/october/laugh.mp3">
                            Your browser does not support HTML5 Audio. Please Upgrade Your Browser.
                    </audio>
    <p><img src="/messages4u/2011/images/october/halloween4.jpg" width="600" border="0" usemap="#Map" class="center" style="width: 600px;" />
      <map name="Map" id="Map">
        <area class="growl" id="growl" style="cursor:default;" shape="rect" coords="117,118,225,223" href="#" />
        <area class="laugh" id="laugh" style="cursor:default;" shape="rect" coords="255,244,308,292" href="#" />
      </map>
</p>

As You can see I am attempting to play audio on a mouseover event. I cannot get this to work and yet I am unsure where the error lies.

UPDATE – It appears the mouseenterevent is not working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:40:33+00:00Added an answer on May 26, 2026 at 11:40 am

    There might be some other factors in play. I created a simpler example here; seems to be working (in Chrome):

    http://jsfiddle.net/5PnCt/2/

    It could be that:

    • Your audio files aren’t correctly linked
    • You are, somehow, failing to trigger the mouseenter event
    • You aren’t correctly binding the event

    To test the second case, add something like:

            console.log('playing');
    

    …to one of your mouseenter handlers. If the event is triggered, you should see the log message.

    For the third case, make sure that you either put your scripts AFTER the HTML they affect, or you use the following wrapper to make sure they don’t execute until the HTML loads:

    var $j = jQuery.noConflict();
    $j(document).ready(function(){
        ...code goes here...
    });
    

    You can’t select and bind events to an element if it doesn’t exist on the page, so the order of your code is important. Using document.ready is one way to get around this issue; it tells jQuery to wait until the page completely loads before attempting to execute the script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am unsure why this code will not work. When I click a button
I am attempting to write a user script that makes a cross domain AJAX
Attempting to run a MIB based SNMP script and I running into an issue.
I'm trying to do something that I think should be pretty straightforward but I
I am unsure if this is even possible, but I thought I would ask.
Unsure if I've phrased this correctly, but in the callback how do I reference
Sorry if this is a comp-sci 101 question. I'm just unsure if I'm missing
I'm writing some Erlang code and I'm very unsure whether I should let everything
This is kind of a strange one. I have a CSV that I'm uploading
I am trying to create a script that checks if a certain value is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.