Tagged: x
-
AuthorPosts
-
March 3, 2017 at 11:25 am #1393535
Hi,
I’m wondering is it possible for me to add an x-icon play button over a video player poster image in cornerstone?
I’ve added this x-video-icon code to the css slot (css image attached), however it’s not working:
a.x-video-icon {
position:inherit;}
a.x-video-icon:before {
content: “\f04b”;
position: absolute;
font-family: “FontAwesome”;
font-size: 150px;
top: calc(50% – 127px);
left: calc(50% – 58px);
color: rgba(255, 255, 255, 0.5);
}
a.x-video-icon:hover:before {
color: rgba(255, 255, 255, 1);
}Any help would be greatly appreciated,
Cheers
March 3, 2017 at 10:04 pm #1394072Hi there,
Thanks for posting in.
Please provide the site’s URL that has this issue 🙂 , and if’s behind a coming soon page then please provide the login credentials as well.
Thanks!
March 6, 2017 at 3:22 am #1395919This reply has been marked as private.March 6, 2017 at 3:40 am #1395929Hi,
Upon checking, I can see it’s working.
https://www.screencast.com/t/OjPUozNV
Please clear your browser cache and check again.
Thanks
March 6, 2017 at 4:10 am #1395952This reply has been marked as private.March 6, 2017 at 4:55 am #1396005Hi,
Please replace your code with this.
.x-video-icon { position:inherit; } .x-video-icon:before { content: "\f04b"; position: absolute; font-family: “FontAwesome”; font-size: 150px; top: calc(50% – 127px); left: calc(50% – 58px); color: rgba(255, 255, 255, 0.5); z-index:999999; } .x-video-icon:hover:before { color: rgba(255, 255, 255, 1); }
Hope that helps
March 6, 2017 at 5:23 am #1396032Thanks Paul,
This is great: http://2016testing.piranhabar.ie/wordpress/portfolio-item/aib-gaa/
On last thing though, how do I get the button to disappear, once clicked?
Cheers
Barry
March 6, 2017 at 5:44 am #1396062Hi Barry,
Add this JS script on Cornerstone > Settings Tab > Custom Javascript:
jQuery(document).ready(function($) { $('.mejs-overlay-play').click(function(e) { $(this).parent().parent().parent().parent().parent().addClass('no-after'); }); });
Then add this CSS to on Cornerstone > Settings Tab > Custom CSS:
.x-video-icon.no-after:before { content: "" !important; }
Hope this helps.
March 6, 2017 at 6:07 am #1396086Thanks Paul.
I’ve added these elements, however I’m afraid that it’s still not working. I’m wondering if I need to add (or take out) some of the java script or css tags maybe? (I’ve attached the javascript css for reference),
Cheers
March 6, 2017 at 11:04 am #1396495Hi guys,
Sorry to keep on bugging you on this one.
I’ve tried adding a .closet() value to the javascript code instead of the .parent().parent().parent().parent().parent(), however it didn’t work.
However I’m thinking that the javascript isn’t linking with the css properly as it doesn’t change when I set any differences (opacity, color etc).
Any more ideas on this would be greatly appreciated,
Barry
March 6, 2017 at 1:47 pm #1396698Hi again,
Please remove the previous script first and then add the following script in Appearance > Customize > Custom > Edit Global Javascript:
jQuery(document).ready(function($) { $('.mejs-overlay-play').click(function(e) { $(this).parents('.x-video.player').addClass('hide-icon'); }); });
Then add the following CSS code in Appearance > Customize > Custom > Edit Global CSS:
.hide-icon:before { content: "" !important; }
Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!
March 7, 2017 at 4:13 am #1397481This reply has been marked as private.March 7, 2017 at 4:14 am #1397482This reply has been marked as private.March 7, 2017 at 8:18 am #1397740Hi There,
I can see the issue that the code is not working. Although, when I tried in just adding on the console it works. This means that there’s something from your setup that is preventing the code from working.
The only issue I am seeing on the console is the GOOGLE MAP API warning from Ubermenu. Please go to Appearance > Ubermenu > General Settings Tab > Assets Tab: Load Google Maps API: Uncheck this option. Try again after this.March 9, 2017 at 12:27 pm #1400815Thanks Lely,
I tried this and I still no luck, I’m afraid.
I’ve also tried disabling all the plug ins, testing and still no good.
I’m currently testing the click function using an alert message, however it is not appearing in the console of the page:
Here is the code:
/* X-video-icon – Hide on click – START */
jQuery(function($) {
$(‘.mejs-overlay-play’).click(function(e) {
alert( “HELLOO00000” );});
});
/* X-video-icon – Hide on click – END */I’m wondering if this means it’s not responding to the video player overlay in cornerstone?
If not, can you think of any of the other plugins that can occasionally conflict with custom javascript?
Many thanks,
Barry
-
AuthorPosts