View Full Version : YouTube Gallery Wall Close option for Videos?

08-19-2016, 05:30 AM
URL: http://dynamicdrive.com/dynamicindex17/youtube-gallery-wall.htm

Thanks for another great script. I have installed the YouTube Gallery Wall and it works great however I was wondering if I can add a "Close Video" in the video window as although the video can be stopped and started no problems, the share option also works - clicking outside the video window to close the video only works sometimes and when viewing on a small device there is no room to click outside the window.

Thanks and regards

08-19-2016, 09:39 PM
Sure, try the below modified .js and .css files. It adds a Fontawesome based close button to the upper right corner of the screen to dismiss the player. In the .js file, you can modify the fontawesome font used here:

+ '<i id="ytubeclose" class="fa fa-times-circle-o" aria-hidden="true"></i>'

and to modify the color/size of button, here in the .css file:

#ytubeclose{ /* close button inside video player */
font-size: 60px;
position: absolute;
right: 5px;
top: 5px;
color: white;
z-index: 1000;
cursor: pointer;

09-04-2016, 09:41 AM

Thanks very much for your answer. It successfully created the icon but it was on the thumbnail overlay which couldn't be accessed once the video is opened overtop of it. What I did in the end was to add a graphic elsewhere with a suitable "id" and add a line to the end of the function that creates the lightbox within youtubegallerywall.js that adds an onclick event to the graphic identified by id. The event calls the hidelightbox() function to close the running video and it works sweet across the range of devices - pcs, laptops, mobiles, tablets etc. I've attached the code.

Thanks very much for your help.