Solved

gif banner animation loads randomly in mobile

Posted on 2016-11-23
3
96 Views
Last Modified: 2016-11-28
Hi, I have an gif animation banner overlay on http://www.telstra.com.au/deals page. This loads fine in desktop. in small screen devices and mobile the animation is showing up randomly. Sometimes gif loads animation doesnt play and will show up the html banner beneath it.

any idea why this is happening
0
Comment
Question by:Perumal_RM
  • 2
3 Comments
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 41899956
What's its the  file size, and dimensional size, of the gif; and which responsive css framework, if any,  are you using?
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 41900515
open this image in your browser : http://www.drodd.com/images15/numbers15.jpg
test page : https://jsfiddle.net/q46amj2h/

So it's not a GIF but here you can do what you want and have the hand on the animation to be sync.

<div id="countdown">
  <a href="#">
    <img src="http://www.drodd.com/images15/numbers15.jpg" class="img10" width="1600" height="1200" />
  </a>
</div>

Open in new window


jQuery(function($) {
	var counter = 10;
	$("#countdown img").load(function() {
		var t = setInterval(function() {
    	counter--;
      if(counter<1) 
      	clearInterval(t);
      else
    		$("#countdown img").attr("class", "img"+counter);
    }, 1000);		 	
  });
});

Open in new window


#countdown a {
    width: 364px;
    height: 364px;
    overflow: hidden;
    display: block;
    position: relative;
}
#countdown img {
    position: absolute;
    border: 0;
}
.img1  {
    top: 0;
    left: 0;
}
.img2  {
    top: 0;
    left: -417px;
}
.img3 {
    top: 0;
    left: -829px;
}
.img4 {
    top: 0;
    left: -1236px;
}
/* SECOND LINE */
.img5 {
    top: -410px;
    left: 0;
}
.img6 {
    top: -410px;
    left: -417px;
}
.img7 {
    top: -410px;
    left: -829px;
}
.img8 {
    top: -410px;
    left: -1236px;
}
/* THIRD LINE */
.img9 {
    top: -836px;
    left: 0;
}
.img10 {
    top: -836px;
    left: -417px;
}

Open in new window

0
 
LVL 19

Expert Comment

by:NerdsOfTech
ID: 41900530
That's probably the issue then. Some mobile devices won't allow Javascript/jQuery/etc . Therefore the best approach would be to slice the image up and make an actual .gif of it. Use Photoshop or your favorite image editor to do this or create an extremely low budget gig for an expert to do it for you.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Find out what you should include to make the best professional email signature for your organization.
A new Acronis survey shows people often have conflicting thoughts about data protection.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

829 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