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

MouseUp event on overlapping images

New Here ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

 

Hello,

  I am using a MouseUp script on both Image9_af_image (star) and Image8_af_image (peach background). However, when they are overlapping, as in the screenshot below, and I click within the star's box, only Image8_af_image receives the MouseUp event. Is there a way to make Image9_af_image receive it instead or have both receive it?

PDF Clip.png

TOPICS
Acrobat SDK and JavaScript , Windows

Views

377

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 ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

Having overlapping fields is a bad idea, since you can't (explicitly) control their z-order (ie. which one is on top and which one is at the bottom of the "stack"), so no, you can't do that.

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 ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

Can I add a MouseUp event to the document itself, then?

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 ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

No.

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 ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

What you can do, though, is create four fields that cover the rest of the page, bordering with Image9, and all doing the same thing when clicked.

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 ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

I'm not sure what that would do. I'm using the click on Image8 to place Image9

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 ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

What do mean by "place Image9", 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
New Here ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

This is all a bit moot as I think I've just found out that custom scripts of this kind only work in Acrobat Pro and not in Reader but...

 

I was trying to set up a system where the person clicks on an image (field) and then clicks somewhere on the background and the script moves the image to the coordinates where they clicked. This works but, once the two overlap, they can't click on the images anymore.

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 ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

That can work in Reader, but the overlapping issue is indeed a problem. You will have to resize the other fields each time the image is moved, so they don't overlap.

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 ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

I tested it on Reader on Android and it didn't work. Sadly, I have to make it as cross-platform as possible, so it's back to standard forms.

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 ,
Aug 06, 2022 Aug 06, 2022

Copy link to clipboard

Copied

LATEST

No, it can't work on a mobile device.

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