Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jun 2014
    Posts
    37
    Member #
    39433
    Liked
    1 times

    Background Image in Div with Colour Caption that follows ALPHA

    Hi All,

    As you can see by this fiddle, everything is working great, except i would like the blue that is behind the text that is reveal on hover, to cover the entire icon (ie. until where the transparency begins)

    Any ideas?

    Thanks

    HTML
    Code:
    <label for="modal_2">
      <a class="img-hover">
        <div class="item nudge1 width1 cat-2 cat-4" id="bg1">
          <div class="overlay" style="background-image:url(http://gk-usa.org/wp-content/uploads/2014/06/learn-icon.png);background-size:cover;top: 0;
      left: 0;">
    
            <span class='caption'>Hello World</span>
          </div>
        </div>
      </a>
    </label>
    CSS
    Code:
    a.img-hover:hover {
      -webkit-filter: drop-shadow(0px 0px 10px #00F);
      filter: drop-shadow(0px 0px 10px #00F);
    }
    
    #bg1 {
      width: 90vmin;
      height: 90vmin;
      margin: 0 auto;
      -webkit-filter: blur(50px);
      filter: blur(50px);
      background-size: cover;
      -webkit-animation: sharpen 4s;
      animation: sharpen 4s;
      -webkit-animation-delay: 0s;
      animation-delay: 0s;
      -webkit-animation-fill-mode: forwards;
      animation-fill-mode: forwards;
    }
    
    #bg1::after {
      content: '';
      -webkit-animation: preload 1s;
      animation: preload 1s;
      -webkit-animation-delay: 1s;
      animation-delay: 1s;
    }
    
    @-webkit-keyframes preload{0%{background-image:url(http://gk-usa.org/wp-content/uploads/2014/06/learn-icon.png)}
    }
    @keyframes preload{0%{background-image:url(http://gk-usa.org/wp-content/uploads/2014/06/learn-icon.png)}
    }
    @-webkit-keyframes sharpen{0%{background-image:url(http://gk-usa.org/wp-content/uploads/2014/06/learn-icon.png);-webkit-filter:blur(20px);filter:blur(20px)}
    100%{background-image:url(http://gk-usa.org/wp-content/uploads/2014/06/learn-icon.png);-webkit-filter:blur(0px);filter:blur(0px)}
    }
    @keyframes sharpen{0%{background-image:url(http://gk-usa.org/wp-content/uploads/2014/06/learn-icon.png);-webkit-filter:blur(20px);filter:blur(20px)}
    100%{background-image:url(http://gk-usa.org/wp-content/uploads/2014/06/learn-icon.png);-webkit-filter:blur(0px);filter:blur(0px)}
    }
    
    /*Isotope Divs */
    .item {
      font-size: 8pt;
      text-align: justify;
      float: left;
      width: 332px;
      height: 213px;
      background: 0;
      margin: 80px;
      border: 0px solid black;
    }
    .overlay {
      opacity: 0;
      height: 100%;
      text-align: center;
      -webkit-transition: all .2s ease-out;
      -moz-transition: all .2s ease-out;
      -o-transition: all .2s ease-out;
      -ms-transition: all .2s ease-out;
      transition: all .2s ease-out;
    }
    .item:hover .overlay {
      opacity: 1;
      height: 100%;
      text-align: center; 
    }
    .caption {z-index:100;
      color: white;
    
      opacity: 0;
      position: relative;
      top: 50%;
    background-color: rgba(0, 0, 255, .60);
      -webkit-transform: translateY(-50%);
      -ms-transform: translateY(-50%);
      transform: translateY(-50%);
      -webkit-transition: all .4s ease-out 0.4s;
      -moz-transition: all .4s ease-out 0.4s;
      -o-transition: all .4s ease-out 0.4s;
      -ms-transition: all .4s ease-out 0.4s;
      transition: all .4s ease-out 0.4s;
    }
    .item:hover .caption {
      opacity: 1; 
    }

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Code:
    .item:hover .caption {
      opacity: 1; 
      display: block;
    }
    Try that.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Member
    Join Date
    Jun 2014
    Posts
    37
    Member #
    39433
    Liked
    1 times
    ok i went for a cheap way out.

    which is to just switch div content using jquery. therefore i will make a separate image that simulates a blue filter, then the caption is working well too.

    https://jsfiddle.net/postcolonialboy/mc0fc9c8/

    thanks anyway

  5. #4
    Senior Member Vapr_Arts's Avatar
    Join Date
    Oct 2013
    Location
    California
    Posts
    1,930
    Member #
    37412
    Liked
    544 times
    Quote Originally Posted by 452wfr234 View Post
    ok i went for a cheap way out.

    which is to just switch div content using jquery. therefore i will make a separate image that simulates a blue filter, then the caption is working well too.

    https://jsfiddle.net/postcolonialboy/mc0fc9c8/

    thanks anyway
    I never understand why people will do this. No one benefits from doing it the "cheap way". If you're doing it for a client the client is losing out, and either way you look at it you're losing out...

    This is an opportunity for you to learn something. Game showed you an extremely easy way to do it. Just makes no sense.


    Sent from my iPhone using Tapatalk


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Tags for this Thread

All times are GMT -6. The time now is 10:48 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com