Solved

gif overlay

Posted on 2016-11-21
3
32 Views
Last Modified: 2016-11-23
Hi,

I am dynamically replacing a background image of an span element with a gif file on page load. and showing back the original image when the gif is played fully once using jquery.

While hiding gif and showing back the original background image, there is a white background showing up. How to make it transparent, or remove it?

thanks.
0
Comment
Question by:Perumal_RM
3 Comments
 

Author Comment

by:Perumal_RM
ID: 41897054
I have fixed this with placing an image element inside the <Span> tag. Now the issue is with the small screen devices.

<div class="page-takeover-gradient" style="display: block;">
      <picture class="hidden-lg">
        <source media="(max-width: 768px)" srcset="mobile-768x460.jpg">
        <img srcset="" class="img-responsive">
      </picture>
</div>

Open in new window


is my code for the banner, I want to overlay a gif over the banner. How should I do this. any help much appreciated.

Thanks.
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41897904
Can we see more code.

How do you want to overlay the gif - over the whole page or just part of it. It is not clear from your question what the requirement is.

BTW not all mobile devices support the srcset attribute. You can't rely on it currently to be available in all browsers.
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 41897965
try this :
<div id="container">
  <div class="page-takeover-gradient" style="display: block;">
        <picture class="hidden-lg">
          <source media="(max-width: 768px)" srcset="mobile-768x460.jpg">
          <img srcset="" class="img-responsive">
        </picture>
  </div>
  <div class="overlay-gif-inside">
    <img src="/path/to/your/filename.gif" />
  </div>
</div>

Open in new window


css :
#container {
  position: relative;
  width: 768px;
  height: 460px;
}
.page-takeover-gradient, .overlay-gif-inside {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.overlay-gif-inside {
  z-index: 10000;
}
.overlay-gif-inside img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

Open in new window

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now