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

Is there a way to add an onclick event to a button to show an image at the click location?

New Here ,
Apr 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

Hi,

I'm trying to create a custom hotspot that works as a quiz object. I want to show a different non-animated image at the location of the click depending on whether the answer is correct or incorrect (only the same animation is currently allowed for all hotspots on the same quiz page). I feel like there should be a way to do this in javascript, but I don't any experience coding. Is there?
Thanks!

Views

378

Translate

Translate

Report

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 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

Sorry for not understanding what you want exactly? Do you want to create a custom hotspot slide or do you want to add a functionality to the existing Hotspot quiz slide. Personally I never use the default Hotspot quiz slide because it is too limited (no partial scoring is main reason). You also mention a 'quiz object'? Do you mean that the button gets a score when clicked correctly?  

Maybe you simple want to replace the feedback messages (Correct/Wrong) by an image? That is very easy. The feedback messages are in a shape, and you can fill each shape with an image.

 

Votes

Translate

Translate

Report

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
New Here ,
Apr 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

I want to create a custom hotspot slide that shows one type of image at the location of the mouse click when it is correct, and another when it is incorrect. Then after all selections re made, I'm using a custom submit button to provide actual feedback.

Basically, I'm having learners identify an area in a photo that is a distraction. they can click whereever they want in the photo I've already arrange hotspots so that anything that is a distraction shows up with a frame around the distraction, and anything that isn't a distraction doesn't contain the frame. But I would like a way of indicating where the user has clicked so they don't keep clicking the same spots repeatedly (i.e. guessing the answer). Because the incorrect area is large, I would like to just indicate the location of the click with an image (similarly to how the hotspot target is done is the quizzes) without having to create multiple incorrect hotspots to cover the area. Does that make sense?

Votes

Translate

Translate

Report

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
New Here ,
Apr 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

Basically I'm looking to display an image at the click position. Figured there has to be a way in Javascript.

Votes

Translate

Translate

Report

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 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

LATEST

I will leave you to the JS experts here, cannot help you although I now understand what you want exactly. 

Votes

Translate

Translate

Report

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
Resources
Help resources