Please help me jquery random click
+3
Draxion
SLGray
infotienminh
7 posters
Page 1 of 1
Please help me jquery random click
I have the following code
What can I do with this code when reloading the page ramdom click (tab1,tab2,tab3)
I need the code every time I reload the page and then random click the tab
- Code:
<a class="tab1"></a>
<a class="tab2"></a>
<a class="tab3"></a>
What can I do with this code when reloading the page ramdom click (tab1,tab2,tab3)
- Code:
$('.ramdomtab1,2,3').click();
I need the code every time I reload the page and then random click the tab
Last edited by infotienminh on January 17th 2021, 9:07 am; edited 1 time in total
infotienminh- New Member
- Posts : 5
Reputation : 2
Language : vietnamese
Re: Please help me jquery random click
The topic was posted in the wrong section, so I have moved it to the correct section.
|
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
infotienminh likes this post
Re: Please help me jquery random click
Sorry, I'm a little puzzled about what you are trying to accomplish. Can you elaborate a little more?
infotienminh likes this post
Re: Please help me jquery random click
I need 1 jquery every time I reload the page, it will automatically click the class ( tab1,tab2,tab3 random)
Sorry, I use google translate so the translation is a bit wrong, do you understand what i mean
Sorry, I use google translate so the translation is a bit wrong, do you understand what i mean
infotienminh- New Member
- Posts : 5
Reputation : 2
Language : vietnamese
Re: Please help me jquery random click
Where will this be placed ? I am asking as the code would have to be used on page to start off with. Would this just be on your home page or on all ages ?
infotienminh likes this post
Re: Please help me jquery random click
I am just showing on the homepage
infotienminh- New Member
- Posts : 5
Reputation : 2
Language : vietnamese
Re: Please help me jquery random click
SarkZKalie wrote:Could you please provide us your site URL here?
- Code:
https://raovat24.forumvi.com/
infotienminh- New Member
- Posts : 5
Reputation : 2
Language : vietnamese
Re: Please help me jquery random click
Dear @infotienminh
Give a try adding this javascript code and see if it works
Regards
Give a try adding this javascript code and see if it works
- Code:
$(function() {
var min = -1;
var max = 3;
// and the formula is:
var random = Math.floor(Math.random() * (max - min + 1)) + min;
$('.tab'+random).click();
});
Regards
skouliki, TheCrow and infotienminh like this post
Re: Please help me jquery random click
so great thank you so muchNiko wrote:Dear @infotienminh
Give a try adding this javascript code and see if it works
- Code:
$(function() {
var min = -1;
var max = 3;
// and the formula is:
var random = Math.floor(Math.random() * (max - min + 1)) + min;
$('.tab'+random).click();
});
Regards
infotienminh- New Member
- Posts : 5
Reputation : 2
Language : vietnamese
Niko likes this post
Re: Please help me jquery random click
When your request is complete, please mark it as Solved.
infotienminh likes this post
Re: Please help me jquery random click
Problem solved & topic archived.
|
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum