Solved

gif banner animation loads randomly in mobile

Posted on 2016-11-23
3
91 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

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

Suggested Solutions

Title # Comments Views Activity
Problem with spacing columns on a row in a table 10 25
Change Background Color of Website 5 19
jquery datepciker end date add 6 days 6 40
Question about JQuery and asp.net 3 27
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
A new Acronis survey shows people often have conflicting thoughts about data protection.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

821 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