You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#116580 Adding Popup to image removes its float

Posted in ‘Mediabox’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Wednesday, 10 April 2024 08:11 BST

umbrellaumbrella

Not sure if this a bug or not and if it goes here or under JCE Mediabox, but when I float an image right or left and then add a JCE popup, the float goes away.

Is this expected behavior?

Basically, I can't have a popup on a floated image?

Ryan

The float should be copied onto the anchor element that surrounds the image (by Mediabox when creating the popup). Please post a link to an example.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

umbrellaumbrella

Figured it out, you can't make the image a % for width. Guess I'll have to add a max-width or something.

Basically, if you use a % on the image width, it won't float with a popup.

umbrellaumbrella

And thanks for the quick follow up. Appreciate it.

Ryan

Please try MediaBox 2.1.10 Beta - https://www.joomlacontenteditor.net/downloads/mediabox/development

This fixes the % float issue by calculating and resetting the image width as a pixel value when the popup link is created.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

umbrellaumbrella

We need to be able to set images as a % for various reasons.

I changed the width to px added a maximum width on the link for the popup and it fixed it. Perhaps you could take the image width and place it in the link as a max-width AND convert the image size % or vw to px? Just a thought.

Thanks for the help, btw.

Ryan

The Mediabox beta I linked to will take the % value you set as the image width and convert it to a pixel width. On most websites, images are already set to have a max-width value of 100% to make them responsive, via a css rule in the template stylesheet, eg:

img {
    max-width:100%;
    height:auto;
}

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.