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 3626790
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:48:24+00:00 2026-05-18T23:48:24+00:00

I have tried every possible combination of methods for replacing an image but have

  • 0

I have tried every possible combination of methods for replacing an image but have found no solution that works.

I uploaded the problematic code here: http://dl.dropbox.com/u/2959730/index.html

I would suggest downloading the source and trying your code. The problem lies with the player.playPause() function that should be attached to the #playButt img.

Please help I’ve been struggling for hours now!

EDIT:

I’ve corrected everything and as per suggestion I’m using this code now for playPause(), but it still doesn’t work!. This is the most frustrating thing I have ever dealt with…

this.playPause = function(){  
    this.status = !this.status;  
    var status = this.status;
    var playEl = document.getElementById('play');
    $("#play").fadeOut(200, function(){  
        if(status)  
            playEl.src = "img/pauseButton.png";
        else  
            playEl.src = "img/playButton.png";
        $("#play").fadeIn(200); 
    }) 
} 
  • 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-18T23:48:24+00:00Added an answer on May 18, 2026 at 11:48 pm

    playPause() is defined as a property of var player, in playlist.js.

    Your onclick onclick="playPause(); return false;" isn’t calling playPause because it can’t find the function in the global scope. You need to change your onclick to:

    onclick="player.playPause(); return false;"
    

    Update:

    The problem is with this callback:

    $("#play").fadeOut(200, function(){  
        if(this.status)  
            playEl.src = "img/pauseButton.png";
        else  
            playEl.src = "img/playButton.png";
    }).fadeIn(200);  
    

    this.status is undefined inside that callback since this now refers to the element #play. To fix this problem you need to declare var status = this.status before the callback, and test if(status) inside the callback.

    Two other things:

    1. The .fadeIn(200) should be placed inside the callback, otherwise it is running before the fadeOut completes (so there’s no fade effect at all).
    2. You don’t need var playEl = document.getElementById('play'); since you’re using jQuery to grab the element. Inside the callback, the this keyword refers to the element already.

    The complete code should be:

    var status = this.status = !this.status;
    $("#play").fadeOut(200, function(){  
        if(status)  
            this.src = "img/pauseButton.png";
        else  
            this.src = "img/playButton.png";
        $(this).fadeIn(200);
    });
    

    Another Update:

    In addition to the above fix, there’s a further problem. It looks like there are two elements on the page with id="play". In fact, the whole #ipod2 is duplicated. I checked the source code, but it’s not there, only in the live DOM. If you $("#play").remove(); in the console, you’ll see that the image replacement code now works. However, you’ll need to find out where ipod2 is being cloned in the JS and fix that.

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

Sidebar

Related Questions

I have tried approximately every possible combination of RegexOptions.MultiLine and escaped backslashes in order
I have tried every way I can think of with this, but just not
I have tried making every div 75px and the table within the div but
I have looked on here and tried every answer available, but it is still
I have tried every way possible and can't seem to limit the scope_to method
I have two distinct vectors from which I've indexed every possible combination of perfect
I have tried every install method I can think of to install RPy2 on
I have searched and tried every example regarding singleton, public, and global variables in
Hi i want to apply style on every 2nd <li> i have tried <script>
Arg, I'm a RoR newbie, feeling my way, and every possible reasonable combination I've

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.