Please help me jquery random click

Go down

Solved Please help me jquery random click

Post by infotienminh December 27th 2020, 9:20 pm

I have the following code
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, 8:07 am; edited 1 time in total
infotienminh
infotienminh
New Member

Posts : 5
Reputation : 2
Language : vietnamese

View user profile

Back to top Go down

Solved Re: Please help me jquery random click

Post by SLGray December 27th 2020, 10:13 pm

The topic was posted in the wrong section, so I have moved it to the correct section.
Please read our forum rules:  ESF General Rules


Please help me jquery random click Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 49069
Reputation : 3418
Language : English
Location : United States

View user profile https://forumsclub.com/gc/128-link-directory/

infotienminh likes this post

Back to top Go down

Solved Re: Please help me jquery random click

Post by Draxion December 28th 2020, 2:22 am

Sorry, I'm a little puzzled about what you are trying to accomplish. Can you elaborate a little more?


Please help me jquery random click Draxio14
NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as Please help me jquery random click Solved11 when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself
Draxion
Draxion
Support Moderator
Support Moderator

Male Posts : 2508
Reputation : 321
Language : English
Location : USA

View user profile https://www.talesoftellene.com/

infotienminh likes this post

Back to top Go down

Solved Re: Please help me jquery random click

Post by infotienminh December 28th 2020, 6:44 pm

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
infotienminh
infotienminh
New Member

Posts : 5
Reputation : 2
Language : vietnamese

View user profile

Back to top Go down

Solved Re: Please help me jquery random click

Post by Ape December 28th 2020, 7:03 pm

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 ?


Please help me jquery random click Left1212Please help me jquery random click Center11Please help me jquery random click Right112
Please help me jquery random click Ape_b110
Please help me jquery random click Keep_s10
Please help me jquery random click Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 16529
Reputation : 1774
Language : fluent in dork / mumbojumbo & English haha

View user profile http://chatworld.forumotion.co.uk/

infotienminh likes this post

Back to top Go down

Solved Re: Please help me jquery random click

Post by infotienminh December 28th 2020, 7:13 pm

I am just showing on the homepage
infotienminh
infotienminh
New Member

Posts : 5
Reputation : 2
Language : vietnamese

View user profile

Back to top Go down

Solved Re: Please help me jquery random click

Post by SarkZKalie December 29th 2020, 3:50 am

Could you please provide us your site URL here?


Please help me jquery random click Sarkzk10
SarkZKalie
SarkZKalie
Support Moderator
Support Moderator

Male Posts : 1254
Reputation : 202
Language : English

View user profile https://rotavn.forumotion.com/

Back to top Go down

Solved Re: Please help me jquery random click

Post by infotienminh January 11th 2021, 5:59 pm

@SarkZKalie wrote:Could you please provide us your site URL here?
Code:
https://raovat24.forumvi.com/
my forum page
infotienminh
infotienminh
New Member

Posts : 5
Reputation : 2
Language : vietnamese

View user profile

Back to top Go down

Solved Re: Please help me jquery random click

Post by Niko January 13th 2021, 1:00 pm

Dear @infotienminh

Give a try adding this javascript code and see if it works  thumleft

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 :rose:
Niko
Niko
Hyperactive

Male Posts : 2337
Reputation : 106
Language : English, French, Italian, Spanish, Latin

View user profile https://www.fmcodes.com

skouliki, TheCrow and infotienminh like this post

Back to top Go down

Solved Re: Please help me jquery random click

Post by infotienminh January 16th 2021, 1:48 pm

@Niko wrote:Dear @infotienminh

Give a try adding this javascript code and see if it works  thumleft

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 :rose:
so great thank you so much
infotienminh
infotienminh
New Member

Posts : 5
Reputation : 2
Language : vietnamese

View user profile

Niko likes this post

Back to top Go down

Solved Re: Please help me jquery random click

Post by skouliki January 16th 2021, 2:12 pm

When your request is complete, please mark it as Solved.
skouliki
skouliki
Manager
Manager

Female Posts : 10883
Reputation : 1370
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

infotienminh likes this post

Back to top Go down

Solved Re: Please help me jquery random click

Post by skouliki January 17th 2021, 12:10 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules
skouliki
skouliki
Manager
Manager

Female Posts : 10883
Reputation : 1370
Language : English,Greek
Location : Greece

View user profile http://iconskouliki.forumgreek.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum