• Resolved pexel

    (@pexel)


    Hello;
    I wanted to write because I couldn’t find a solution to something. Now, in the Mobile version, when the user presses the calculate button, he counts as 3 2 1 and prints the result.

    if(jQuery(this.form).valid()){my_counter=3,my_interval=setInterval(function(){jQuery(".counter").html("Hesapl?yoruz : " + my_counter + " saniye"),(my_counter-=1)<0&&(clearInterval(my_interval),jQuery(".counter").html(""),EVALEQUATIONS())},1e3);}
    

    I want to do this for mobile version. When the user says calculate

    <div class="elementor-widget-container">
    			<figure class="wp-block-table is-style-stripes"><table class="table table-bordered table-striped"></table></figure>
    		</div>

    It will automatically descend after counting the seconds to the result section. Because this is important for me to provide user experience. The user has to scroll down while searching for results.

    Sample : Hesaplama

    I hope you have a solution suggestion, I tried a lot but I couldn’t succeed.

    Thank you

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter pexel

    (@pexel)

    Thank you very much for your support. You seriously took the time and answered all of our questions. We’ve come to the end, how do we run this on mobile only?

    if (jQuery(this.form).valid()) {
            my_counter = 3,
            my_interval = setInterval(function(){
                jQuery(".counter").html("Hesapl?yoruz : " + my_counter + " saniye");
                if(my_counter == 0){
                    clearInterval(my_interval);
                    jQuery(".counter").html("");
                    EVALEQUATIONS();
                    jQuery('html, body').animate({
                        scrollTop: jQuery('[data-id="pex32pe87"]').offset().top
                    }, 2000);
                }
                my_counter--;
            }, 1000);
      }
    Plugin Author codepeople

    (@codepeople)

    Hello @pexel

    There are different alternatives to check if the browser is in mobile or not. One solution would be to check the userAgent as follows:

    if (jQuery(this.form).valid()) {
            my_counter = 3,
            my_interval = setInterval(function(){
                jQuery(".counter").html("Hesapl?yoruz : " + my_counter + " saniye");
                if(my_counter == 0){
                    clearInterval(my_interval);
                    jQuery(".counter").html("");
                    EVALEQUATIONS();
                    if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
                    jQuery('html, body').animate({
                        scrollTop: jQuery('[data-id="pex32pe87"]').offset().top
                    }, 2000);
                    }
                }
                my_counter--;
            }, 1000);
      }

    With the previous code, the animation to jump the results will work only on mobiles.

    Best regards.

    Thread Starter pexel

    (@pexel)

    I can’t thank you enough. It is good that there are people like you who love their job.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘User experience’ is closed to new replies.