Tagged: x
-
AuthorPosts
-
March 7, 2017 at 5:19 am #1397552
Hi,
I hope you can help me please?
I am trying to make an entire section link to a Youtube video, displayed in a lightbox. The section has an animated GIF background and some text over the top describing the video and a large play icon.
I have found help articles that describe adding some jquery to make a section a link. And I’ve also found details of how to create a lightbox shortcode to display video – but not how to use them together – or even if this is the best way to achieve this result?
I will add site URL and access details in the following private message.
Thanks for your help.
Mark
March 7, 2017 at 5:25 am #1397560This reply has been marked as private.March 7, 2017 at 5:44 am #1397582Hi there,
Please add a video in an empty page, use No header-No footer template for this page.
Insert following code under cornerstone settings tab/custom js :
jQuery(".home #x-section-1").wrap("<a href='#'></a>");
Instead of
#
add page’s URL.Hope it helps.
March 7, 2017 at 5:52 am #1397591Hi Christopher,
I’m not quite sure why I need to add the video to a new blank page?
I have added the following jquery the homepage –
jQuery(".home #x-section-1").wrap("<a href='https://www.youtube.com/embed/joPjqEGJGqU?list=PLLtjKBfcXe9jQnydbCYKRwtVcFjMIwPRt'></a>");
But this just redirects to the Youtube video page. I’d like the Youtube video to open in an X lightbox – so that the user can simply close the lightbox and be back on the site.
Is that possible please?
Thanks
Mark
March 7, 2017 at 5:52 am #1397593`jQuery(“.home #x-section-1”).wrap(“<a href=’https://www.youtube.com/embed/joPjqEGJGqU?list=PLLtjKBfcXe9jQnydbCYKRwtVcFjMIwPRt’></a>”);’
March 7, 2017 at 6:18 am #1397630Hi there,
Did you add light box shortcode to your page?
Thanks.
March 7, 2017 at 7:50 am #1397711Hi Christopher,
Yes, I have it within the text element in that section – [lightbox]
But I don’t see anything with the jquery you sent me that would
trigger the lightbox?Thanks
Mark
March 7, 2017 at 10:00 am #1397860Hi Mark,
I could not check your site using http://2016.bristolvineyard.com/wp-admin/ I am getting too many redirects.
Lets try like this.
Add a lightbox selector to your page to a raw code element.
[lightbox selector=”.lightvideo”]
Add the class lightvideo to the section that you want to link to your video lightbox.
Add the code provided by christian to make the section linkable, if it is the first section, you will keep #x-section-1 otherwise you need to change #x-section-1 for the correspondent section
jQuery(".home #x-section-1").wrap("<a href='https://www.youtube.com/embed/joPjqEGJGqU?list=PLLtjKBfcXe9jQnydbCYKRwtVcFjMIwPRt'></a>");
That way when you click on your section the class should trigger the video in the lightbox.
Let us know how it goes,
Joao
March 7, 2017 at 10:17 am #1397879This reply has been marked as private.March 7, 2017 at 11:59 am #1398049Hi Mark,
My Bad I understood what happens now. Since the JS code wraps the your section in
<a>
the launch class needs to be on this<a>
not on the section inside it.So I updated your js to :
jQuery(".home #x-section-1").wrap("<a class='lightvideo' href='https://www.youtube.com/embed/joPjqEGJGqU?list=PLLtjKBfcXe9jQnydbCYKRwtVcFjMIwPRt&rel=0'></a>");
And now it works.
Hope it helps
joao
March 7, 2017 at 12:12 pm #1398072Hi Joao,
That’s great.
One more quick (I hope) question please.
Is it possible to move the lightbox close/fullscreen icons from the top left to the top right? Also, is it possible to change them from red to black on white?
Thanks for your help.
Mark
March 7, 2017 at 2:22 pm #1398216Hi,
I’ve found this article which I think will solve the problem of icon location, which just leaves changing their colour?
Thanks
Mark
/*
// Moves the closing and fullscreen buttons for the lightbox closer to the lightbox frame
*/.ilightbox-toolbar.light {
top: 5% !important;
left: 83% !important;
}.ilightbox-toolbar.light a:before {
vertical-align: top;
}March 7, 2017 at 2:24 pm #1398217Hi Mark,
Please add the following code to Appereance CUstomizer CUstom CSS
.ilightbox-toolbar.light { left: 96%; } .ilightbox-toolbar.light a.ilightbox-fullscreen:before , .ilightbox-toolbar.light a.ilightbox-close:before { color: black; }
Hope it helps
joao
March 7, 2017 at 3:11 pm #1398271Thanks Joao,
That’s perfect 🙂
Just out of interest, is there a full CSS class/id reference for the lightbox functionality please?
Have a great evening.
Kind Regards
Mark
March 7, 2017 at 3:59 pm #1398323Hi Mark,
I dont think so, you can inspect using Chrome Inspector or Firefox Firebug and find it out 🙂
If you are not familiar with it, I do recommend you starting to play around with it, it is a great tool and will allow you to have loads of freedom when manipulating your websites CSS. On the other hand, we are always here for you.
Cheers
-
AuthorPosts