-
AuthorPosts
-
September 18, 2019 at 2:43 pm #1139502
Hi,
I’m using masonry gallery in my website and I’m trying to customize its features to the best.
When i open an image in the Masonry, i’d like to remove the numbers of the image count on the bottom right, and, if possible, i’d like to remove the “X” button to close the image, or to move it on the right.
My intent is that the open image appears a little bigger by eliminating these data.
I tried to find these settings in the Masonry settings, but i didn’t find anithing: maybe i need a CSS code to do this?
Thanks fot the support!September 21, 2019 at 8:49 pm #1140506Hey Real-3D,
Sorry for the late reply, Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:.mfp-content .mfp-figure .mfp-close,.mfp-content .mfp-figure .mfp-bottom-bar { display: none !important; } .mfp-content .mfp-figure img.mfp-img { padding: 0 !important; }
Then clear your browser cache and check.
Best regards,
MikeSeptember 23, 2019 at 8:44 am #1140867Hi Mike,
Thank you very much, the code you provided works perfectly!
Now the image opens in “full screen” size. Great!I have another issue i’d like to adjust in the masonry galleries.
When I open an image in a masonry gallery, the image is not “fixed” in the middle of the screen, but, if i scroll up or down with my mouse (on pc) or with touch (on mobile) the images moves up and down, showing the images below.
I’d like the image to be “locked” on the screen when opened, even if i scroll up or down.
In the masonry settings there is no setting related to this, maybe i need a css?Thanks a lot for the support and best regards.
September 24, 2019 at 8:57 am #1141266Hi,
Glad to hear that the css worked for you, for your new request I wrote this script which will apply the css overflow-y:hidden; to the page so that it will not scroll, but I had to include a one-second delay for the mouse clicks that trigger it. It may work with a faster delay such as a half-second (500), feel free to test. When the overflow-y:hidden; takes effect the browser scroll bar will disappear, that is just how it works.
This is set to work on any page, but if you find any conflicts we can set it to work on only one page, please check and let us know.Try adding this code to the end of your functions.php file in Appearance > Editor:
function prevent_scrolling_lightbox(){ ?> <script> (function($){ $("a.av-masonry-entry").click(function(){ setTimeout(function () { if ($("body").hasClass("mfp-zoom-out-cur")) { $("html").css("overflow-y","hidden"); } else {} }, 1000); }); $(document).click(function(){ setTimeout(function () { if (!$("body").hasClass("mfp-zoom-out-cur")) { $("html").css("overflow-y","visible"); } else {} }, 1000); }); })(jQuery); </script> <?php } add_action('wp_footer', 'prevent_scrolling_lightbox');
Best regards,
MikeSeptember 24, 2019 at 9:53 am #1141300Hi and thanks.
The code you provided seems to work on pc, but I tried on mobile and on Android all is ok, dut on IOS it seems not to work and the images scroll up and down.
I’d like to adjust some details if possible, too. I don’t like that when the “browser scroll bar” disappears the website page becomes a little bigger and smaller covering the scroll bar section (disappeared) every time i open or close an image.
Is it possible to have the browser scroll bar locked but visible? Or, alternatively, invisible, but without the website pages that get bigger or smaller?
Thanks for the support!September 26, 2019 at 5:58 am #1142117Hi,
Unfortunately, the reason this doesn’t work correctly in IOS is due to a bug in web-kit which is out of our control.
The scrollbar being hidden when the code is activated is not intentional, it is just how the browsers handle the rule. Unfortunately, there is not an official rule to stop the scrolling and show the scrollbar, or the other way around.
This is because the css and javascript effects the content of the web browser, a webpage, not the browser itself.
For example, think of a MS Word document that would change the MS Word toolbar when opened.
I hope this makes sense.
Perhaps there is a different way to do this, but this would require excessive customization to work. Sorry, this would be more than we can offer here, If you really want this try hiring a freelancer, you could probably find one on Upwork for a fair price.Best regards,
MikeSeptember 26, 2019 at 8:54 am #1142150Hi Mike and thanks for your reply.
I already imagined that this was a very “hard” request to solve.
Thanks again for the support, i’ll probably keep the actual settings.
Best regards!September 27, 2019 at 2:20 am #1142533Hi,
Hopefully, we were able to help some, Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Masonry gallery image number’ is closed to new replies.