gifplayer icon indicating copy to clipboard operation
gifplayer copied to clipboard

location of <script> $('.gifplayer').gifplayer(); </script>

Open nasser1 opened this issue 6 years ago • 1 comments

Thanks you first for gifplayer. I just downloaded and trying the latest.

I have been trying it and I have small issue. The player seems to require putting

<script>
	$('.gifplayer').gifplayer();
</script>

In the body of the HTML and not in the HEAD, and it has to be at the very end of the HTML page below all earlier entries of <img class="gifplayer" src="media/banana.png" />

If I add it below each img entry, then it does not work well. it seems there has to be once instance of it,

This causes a problem, since the software I am using to generate the HTML splits the large document into multiple separate HTML pages and therefore the code $('.gifplayer').gifplayer(); will not be located on the same page where the gif call is and where it is needed.

I tried adding

<script>
	$('.gifplayer').gifplayer();
</script>

to the HEAD of the HTML page, but that did not work. It had no effect. It seems that is has to be below the code that uses it for some reason in the BODY.

Is it possible to make the player work by putting the script code $('.gifplayer').gifplayer(); in the HEAD of the HTML page instead of the BODY?

This will then work for me, because when splitting the large document, the HEAD of the page is the same for each separate page, and so I will not lose the $('.gifplayer').gifplayer(); as it happens now.

Thank you --Nasser

nasser1 avatar Nov 24 '18 04:11 nasser1

Try wrapping it with $(document).ready to make sure the full document has loaded before calling gifplayer

rubentd avatar Nov 24 '18 06:11 rubentd