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

  • SEARCH
  • Home
  • 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 9125403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:47:46+00:00 2026-06-17T06:47:46+00:00

I have a an image that when you click, this function runs. function img(num)

  • 0

I have a an image that when you click, this function runs.

function img(num) {
    var src = "images/main" + num + ".jpg";
    document.getElementById("popover-image").src = src;
    $("#sheet").css("display", "block");
}

When you click on the “X” (image), this function runs:

function close() {
    $("#sheet").css("display", "none");
}

but it doesn’t work.

Here is how my image is set up:

<img src="images/x.png" alt="Exit" onclick="close()" />

  • 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-06-17T06:47:47+00:00Added an answer on June 17, 2026 at 6:47 am

    John Koerner’s code:

    $("#closeButton").click(function () {
        $("#sheet").css("display", "none");
    });
    

    Your event handler wasn’t being attached properly.

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

Sidebar

Related Questions

I have this method that changes an larger image source on click. I need
I have a little iOS5 app that shows images. I click on the image
I have this piece of code that runs a function to transform a color
I have an image with a click event handler that captures the location where
I have a problem that when I click on the image button instead of
I have image map that can I move, but this map will be so
I have javascript function (that uses Raphael) that on click select area. And I
I currently have an image that changes when you click it but when I
I have an image that rotates 360 on a click event. After the image
I have a simple media gallery with images that click through to other pages.

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.