Link to home
Create AccountLog in
Web Development

Web Development

--

Questions

--

Followers

Top Experts

Avatar of pcumberbatch
pcumberbatch

Stoping an animated gif from freezing
Hi,

My animated gif freezes when I click any link on the page.

I also realized that the background sound stops playing.

Can I get around this?

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

could you post a URL.

Also, if you click on a link is it going to a new page or doing some javascript or what?

CJ

Avatar of pcumberbatchpcumberbatch

ASKER

Can't post a URL at present

This problem is occuring with mailto links and it is also occuring when I open a popup window.

Avatar of singletonsingleton๐Ÿ‡บ๐Ÿ‡ธ

A mailto link brings up another program (the user's email program), and a popup window switches control to another window. In either case the old window no longer has focus

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Is there a way to work around this using JavaScript? ย Can the focus be returned to the main window?

Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

on all your links you have to put the following:
<a href="somewhere.htm" onClick="window.focus();return true;">click here</a>

I think that will work but i am not sure... since you lose the focus to begin with the animations stop so returning the focus doesn't mean they will start again.

CJ

Thanks CJ but as you suspected it does not restart the animation.

I have seen pages where the I can click on a link which opens another window and the animation continues e.g. http://www.travel-centre.com/
but I have not figured out what they are doing to keep the animation going.

PC

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

All the links I clicked on opened in the current window.. which link opened a new window?

CJ

The problem occurs wether the link opens in the same window or a new one. ย 

Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

I meant on the link you provided to:
http://www.travel-centre.com/ย 

If the link opens in the same window.. then the content is being replaced right?

CJ

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


When I first clicked on the top banner a new window was being opened. ย I tried it again with a different browser and a new window opened in addition to loading a new page in the first window.

When you click on the first banner the new page loads with the same banners at the top, however the animation continued to run until the new page loaded.

If you click the first banner and then scroll down to the links below you will notice that after clicking on one of the country names the flags do not stop. ย 

Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

well that site is down right now.

I don't know what to tell you.. I have clicked on links before and the animation didn't stop...that I know.

what kind of animated gif is it? Is it set to loop continuously?

CJ

Yes it is set to loop continuously. It was put together with Microsoft Gif Animator.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

Hmm... are you willing to email the code to me?

CJ

Yes, where to ...

PC

Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

cheekycj@yahoo.com

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


ASKER CERTIFIED SOLUTION
Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Don't wish to use CGI at the moment


I placed this code in the head of the page

<script>
if(location.search=="test.htm")
ย  location = location+"?"+Math.random();
</script>


and this link in the body

<a href="test.htm" target =_blank>Testing New Window</A> ย 

and the initial page refreshes and therfore the animation appears to keep going. ย I would like it to work with a mailto but can't figure out how or if it is possible.

PC

Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

even if you don't add the random num.. it won't stop the gif because you aren't leaving the browser.. when a click on a link tries to launch an external app like Adobe Acrobat, Email , etc.. it stops.

CJ

For some reason the animation was stopping before when a new window is opened, now it is working as you said without the random number.

What about when moving to another page without opening a new window the animation also stops while the next page is being accessed. ย Is there a way to correct this or make it less noticable?

Thanks
PC.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

you mean a framed navigation?

CJ

No

As I have not noticed this problem occuring in those instances.

But is it possible that while the browser searches for the new site/page the animation on the current page can continue or can the screen be made to go blank immediately when a link is clicked before the new page is loaded.

The go to the travel center link above and click the first banner on the page. Then scroll down the page and you will find some flags and click one of the links next to the flags and notice that the animation does not stop

Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

Again that is because it is opening a new browser window.. not application.

if your link opens a new browser window none of your animations will stop either.. its the fact that your link is opening a new application (i.e. email application)

CJ

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


This question has been abandoned. Would the experts please indicate how
this should be closed out. Is there a comment which should be accepted?
Should the points be split? Should it be reduced to zero points and PAQed?
should it be deleted? ย The default in tha absence of direction is for
me to delete.

TIA for helping to clean up the old questions.

teacher_mod
Community Support Moderator
Experts-Exchange
teacher_mod@experts-exchange.com

Avatar of cheekycjcheekycj๐Ÿ‡บ๐Ÿ‡ธ

I am the only expert who participated but I am not sure if the solution was reached.. the code worked fine on my end.. but not on his end :-(

CJ

I have accepted this comment as the answer and will move to PAQ.

Thank you,
ComTech
Community Support Moderator

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.

Web Development

Web Development

--

Questions

--

Followers

Top Experts

Web development includes all aspects of presenting content on intranets and the Internet, including delivery development, protocols, languages and standards, server software, browser clients, databases and multimedia generation.