Solved

gif overlay

Posted on 2016-11-21
3
49 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 54

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
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)

785 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