Cursor ready

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #34842
    Eduardo31
    Eduardo31
    Participant

    Hello, is it possible to have the cursor ready flashing in search bar when the visitor charge the website? The idea is not to have to click for start writing, something like in google.com

    Thank you!

    #34867
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    It should be doable via a custom code. Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

    add_action('wp_footer', 'aspl_add_focus_script');
    function aspl_add_focus_script() {
        ?>
        <script>
            jQuery( function($) {
                setTimeout(function(){
                    $('input.orig').get(0).focus();
                }, 1500);
            });
        </script>
        <?php
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.