Adding custom javascript in Oblect Properties > Events
Forum rules
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Adding custom javascript in Oblect Properties > Events
Hello.
Having an animated gif image (with 5 loopings) I wish to have a user of webpage thw ability to repeat the the animation.
I tried to add in Image > Events the following:
Event: onclick
Action: javascript
Target: history.go(0); This is what I added by hand.
The webpage is reloading and the image proceeds to an new repetion.
Tell me, please, is there something wrong here? I am asking because I added the code by hand.
Thank you.
Having an animated gif image (with 5 loopings) I wish to have a user of webpage thw ability to repeat the the animation.
I tried to add in Image > Events the following:
Event: onclick
Action: javascript
Target: history.go(0); This is what I added by hand.
The webpage is reloading and the image proceeds to an new repetion.
Tell me, please, is there something wrong here? I am asking because I added the code by hand.
Thank you.
Re: Adding custom javascript in Oblect Properties > Events
Isn't the GIF animation automatically repeated?
Re: Adding custom javascript in Oblect Properties > Events
The GIF is repeated automatically only 5 times (it is my choice). But since the image (showing the effect of the mistral wind) has dimensions on the website of 1000X600 pixels, I chose to repeat it only 5 times. If the user wishes to see the wind movement again, he can refresh the webpage to see again the animation.
Of course, I would like just refresh the layoutgrid of the image and not the whole webpage, but I ran into a lot of trouble.
Do you think the history.go(0); option --the way I incorporated it-- will cause problems?
Thank you.
Of course, I would like just refresh the layoutgrid of the image and not the whole webpage, but I ran into a lot of trouble.
Do you think the history.go(0); option --the way I incorporated it-- will cause problems?
Thank you.
Re: Adding custom javascript in Oblect Properties > Events
If it works for you then I think it's ok.
Re: Adding custom javascript in Oblect Properties > Events
It's the solution I was looking for!
Thank you.
may I use it?
Thank you.
may I use it?
- wwonderfull
-
- Posts: 1536
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Adding custom javascript in Oblect Properties > Events
Although it is a demo but you can do the same thing in your project. It was given to use. So Yes, you can can use it without a doubt.
Re: Adding custom javascript in Oblect Properties > Events
@Aris,
Yes! you can use it. Just wanted to make sure it was what you were looking for.
Give me a little bit and I will provide the steps here and share how to do it.
Yes! you can use it. Just wanted to make sure it was what you were looking for.
Give me a little bit and I will provide the steps here and share how to do it.
Re: Adding custom javascript in Oblect Properties > Events
Here are the steps:
1. Open up your button (in my demo I'm using a themeable button with button type set to "link button"), go to the link tab and enter the following in the URL:
You will need to replace "Image1" with the ID of your gif image and replace "images/NameOfGif.gif" with the url path and gif name. If all of your images are placed into the default images folder then you only need to change the name of your gif in the above code.
2. Open up an html object, set Type = Before </body> and enter the following:
1. Open up your button (in my demo I'm using a themeable button with button type set to "link button"), go to the link tab and enter the following in the URL:
Code: Select all
javascript:restart('Image1','images/NameOfGif.gif');
2. Open up an html object, set Type = Before </body> and enter the following:
Code: Select all
<script type="text/javascript">function restart(id,url){var img=document.getElementById(id);img.src="";img.src=url;}</script>
Re: Adding custom javascript in Oblect Properties > Events
Thank you, crispy68.
Your assistance is valuable!!!
Your assistance is valuable!!!
-
-
- Posts: 191
- Joined: Mon May 13, 2019 9:15 pm
Re: Adding custom javascript in Oblect Properties > Events
How would i call a custom javascript in the event ?
I used to have a photographic memory but i ran out of film !!!
Re: Adding custom javascript in Oblect Properties > Events
Choose javascript as the action and enter the code.