Please help me jquery random click Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
+3
Draxion
SLGray
infotienminh
7 posters

    Please help me jquery random click

    infotienminh
    infotienminh
    New Member


    Posts : 5
    Reputation : 2
    Language : vietnamese

    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
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    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.

    infotienminh likes this post

    Draxion
    Draxion
    Helper
    Helper


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

    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?

    infotienminh likes this post

    infotienminh
    infotienminh
    New Member


    Posts : 5
    Reputation : 2
    Language : vietnamese

    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
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19324
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    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 Ape1010

    infotienminh likes this post

    infotienminh
    infotienminh
    New Member


    Posts : 5
    Reputation : 2
    Language : vietnamese

    Solved Re: Please help me jquery random click

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

    I am just showing on the homepage
    SarkZKalie
    SarkZKalie
    Support Moderator
    Support Moderator


    Male Posts : 1442
    Reputation : 220
    Language : English

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


    Posts : 5
    Reputation : 2
    Language : vietnamese

    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
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3231
    Reputation : 248
    Language : English, Italian, French
    Location : Italy

    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:

    skouliki, TheCrow and infotienminh like this post

    infotienminh
    infotienminh
    New Member


    Posts : 5
    Reputation : 2
    Language : vietnamese

    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

    Niko likes this post

    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15311
    Reputation : 1705
    Language : English,Greek
    Location : Greece

    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.

    infotienminh likes this post

    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15311
    Reputation : 1705
    Language : English,Greek
    Location : Greece

    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