Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #181954

    Hello there. Im making a video site, and styled the video overlays to resemble red play buttons, but they only appear when someone hovers. How can i make it so the buttons appear before anyone has hovered? I noticed that the .image-overlay span only appears after the img has been hovered, before it doesnt appear to be there. can i force it to be there at all times?

    thanks

    #182043

    Hey fandragon!

    Can you post the link to your website?

    Best regards,
    Yigit

    #182181
    #182301

    Hey!

    Please try to add this on your custom.css or Quick CSS;

    .image-overlay .image-overlay-inside {
    height: 100%;
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    content: '\E897';
    font-family: 'entypo-fontello';
    border-radius: 10px !important;
    line-height: 60px !important;
    height: 60px !important;
    background-color: #DD0303 !important;
    font-size: 24px;
    }

    Regards,
    Ismael

    #182347

    No, i need them to appear before anyone has hovered. I figured out how to make them stay, i just need a way for them to be there always, even when nobody has hovered yet.

    #182522

    ? Is there something i can do to the php to modify the image overlay to always be there?

    #182539

    Hey!

    I found a way, can you create an administrator account and post it here as a private reply?

    Best regards,
    Josue

    #182595
    This reply has been marked as private.
    #182598

    +1

    I am working on this exact same thing here.
    I do not have a website for you to login to because I’m developing on Localhost here.
    If you have code snippets you could paste here I will be able to figure it out. It’s irrelevant if the element ID’s and CSS properties relate to another site’s code – whether it involves PHP, Javascript, CSS, or a combination of these, I will probably be able to figure it out.

    Thanks.

    #182601

    Hi!

    I tagged Josue in the topic. He can post his solution here :)

    Regards,
    Yigit

    #182647

    Hey!

    It is done: http://greaterclarity.staging.wpengine.com/ (hosted on WPengine)

    I modified js/avia.js, replaced this (431-490):

    	   elements.each(function(e)
           {
                var link      = $(this), current = link.find('img:first');
    
                if(current.hasClass('alignleft')) link.addClass('alignleft').css({float:'left', margin:0, padding:0});
                if(current.hasClass('alignright')) link.addClass('alignright').css({float:'right', margin:0, padding:0});
                if(current.hasClass('aligncenter')) link.addClass('aligncenter').css({float:'none','text-align':'center', margin:0, padding:0});
    
                if(current.hasClass('alignnone'))
                {
                   link.addClass('alignnone').css({margin:0, padding:0});;
                   if(!link.css('display') || link.css('display') == 'inline') { link.css({display:'inline-block'}); }
                }
            });
    
    		elements.on('mouseenter', function(e)
    		{
    			var link  		= $(this),
    				current	 	= link.find('img:first'),
    				url		 	= link.attr('href'),
    				span_class	= "overlay-type-video",
    				opa			= link.data('opacity') || 0.3;
    
    			overlay = link.find('.image-overlay');
    
    			if(!overlay.length)
    			{
    				if(current.outerHeight() > 100)
    				{
    				if(link.height() == 0) { link.addClass(current.get(0).className); current.get(0).className = ""; }
    				if(!link.css('position') || link.css('position') == 'static') { link.css({position:'relative', overflow:'hidden'}); }
    				if(!link.css('display') || link.css('display') == 'inline') { link.css({display:'block'}); }
    
    				if(url)
    				{
    					if( url.match(/(jpg|gif|jpeg|png|tif)/) ) span_class = "overlay-type-image";
    					if(!url.match(/(jpg|gif|jpeg|png|\.tif|\.mov|\.swf|vimeo\.com|youtube\.com)/) ) span_class = "overlay-type-extern";
    				}
    
    				overlay = $("<span class='image-overlay "+span_class+"' style='opacity: 0;'><span class='image-overlay-inside'></span></span>").appendTo(link);
    				}
    			}
    
    			if(current.outerHeight() > 100)
    			{
    				overlay.css({left:current.position().left + parseInt(current.css("margin-left"),10), top:current.position().top + parseInt(current.css("margin-top"),10)})
    					   .css({display:'block','height':current.outerHeight(),'width':current.outerWidth()}).stop().animate({opacity:opa}, 400);
    			}
    			else
    			{
    				overlay.css({display:"none"});
    			}
    
    		}).on('mouseleave', elements, function(){
    
    			if(overlay.length)
    			{
    				overlay.stop().animate({opacity:0}, 400);
    			}
    		});

    With this (431-479):

    elements.each(function(e)
           {
                var link        = $(this),
                    current     = link.find('img:first'),
                    url         = link.attr('href'),
                    span_class  = "overlay-type-video",
                    opa         = link.data('opacity') || 0.3;
    
                if(current.hasClass('alignleft')) link.addClass('alignleft').css({float:'left', margin:0, padding:0});
                if(current.hasClass('alignright')) link.addClass('alignright').css({float:'right', margin:0, padding:0});
                if(current.hasClass('aligncenter')) link.addClass('aligncenter').css({float:'none','text-align':'center', margin:0, padding:0});
    
                if(current.hasClass('alignnone'))
                {
                   link.addClass('alignnone').css({margin:0, padding:0});;
                   if(!link.css('display') || link.css('display') == 'inline') { link.css({display:'inline-block'}); }
                }
    
                overlay = link.find('.image-overlay');
    
                if(!overlay.length)
                {
                    if(current.outerHeight() > 100)
                    {
                    if(link.height() == 0) { link.addClass(current.get(0).className); current.get(0).className = ""; }
                    if(!link.css('position') || link.css('position') == 'static') { link.css({position:'relative', overflow:'hidden'}); }
                    if(!link.css('display') || link.css('display') == 'inline') { link.css({display:'block'}); }
    
                    if(url)
                    {
                        if( url.match(/(jpg|gif|jpeg|png|tif)/) ) span_class = "overlay-type-image";
                        if(!url.match(/(jpg|gif|jpeg|png|\.tif|\.mov|\.swf|vimeo\.com|youtube\.com)/) ) span_class = "overlay-type-extern";
                    }
    
                    overlay = $("<span class='image-overlay "+span_class+"' style='opacity: 0;'><span class='image-overlay-inside'></span></span>").appendTo(link);
                    }
                }
    
                if(current.outerHeight() > 100)
                {
                    overlay.css({left:current.position().left + parseInt(current.css("margin-left"),10), top:current.position().top + parseInt(current.css("margin-top"),10)})
                           .css({display:'block','height':current.outerHeight(),'width':current.outerWidth()}).stop().animate({opacity:opa}, 400);
                }
                else
                {
                    overlay.css({display:"none"});
                }
    
            });

    Final file: http://greaterclarity.staging.wpengine.com/wp-content/themes/enfold/js/avia.js?ver=1

    Cheers!
    Josue

    #182657

    Great, thank you so much! : )

    #182664

    Glad we could help, in the future remember to backup avia.js before updating :)

    Regards,
    
Josue

    #182725

    thank you for all the help. they work great : ) However i’ve encountered a bug, seems like the arrows dont show up sometimes, and sometimes only some of them show up. Seems like sometimes they randomly disappear. What could be causing that?

    #182788

    Hey!

    Can you post a link to a post where the icon isn’t showing up?

    Cheers!
    Josue

    #184619

    Hi Josue,
    Late to the party and getting back with you. Thanks for posting the code. I will look at it soon, but I’m up to my neck in some other parts of the site. When fandragon, gets back with you, feel free to close the thread.

    Thx.

    #184620

    We looking forward to hearing from you :)

    Regards,

    Josue

    #184624

    It’s the same link. Only sometimes when i open the page arrows dont all show up or only some of them show up. Its random so hard to reproduce…

    #184626

    Hello,

    Hard to reproduce indeed, have you tried to deactivate all third party plugins to see if it gets fixed?

    Regards,
    Josue

    #193655

    I’m having a similar problem. if you go here: http://luma-products.com/products/ and mouse over the images, some of them have the arrow overlay, and some dont.. any suggestions?

    thanks,

    Bryce.

Viewing 20 posts - 1 through 20 (of 20 total)
  • The topic ‘Have image overlay always display’ is closed to new replies.