Some thing like this work for you:
jQuery(document).ready(function($){
if ( $(window).width() < 768 || window.Touch) {
$('html, body').animate({
scrollTop: $("#primary").offset().top
}, 2000);
}
});
Related Posts:
- Apply jquery script to only woocommerce product pages and categories
- Scripts not appending to element in AJAX call – why?
- Creating multiple category drop down
- Automatic add space if user enters number(any digit)
- ajax live search for post title
- Enqueuing Script in functions.php vs on the page
- woocommerce target button with class after ajax update
- jquery won’t load in footer
- Woocommerce checkout field maxlength, make input number field only (postcode)
- Replace menu links with # and add name to its li
- Loading CDN that requires jQuery in WordPress
- How to search using ajax for exact phrase or words in an input field?
- how to en-queue jQuery to load before the tag
- I can’t enqueue my scripts – They literally aren’t being added to my site
- PHP mixed with some JS code to update WordPress theme settings
- echo custom fields with AJAX
- Run a jquery script on on a certain template page
- The correct way to add a JavaScript in the functions.php [closed]
- How to load jQuery in TOP of wp_footer?
- Include Jquery libraries in wordpress theme?
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- How to setup a popup registeration page in wordpress with function.php
- wp_set_object_term via js btn frontend
- Hide ‘add to cart’ when certain value in dropdown is selected
- Images with overlay
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Multiple Notifications SetInterval
- Execute jQuery with custom event listener after successfully add an item to the cart
- Some code is added automatically to my site’s header – what is it?
- Why are some custom javascript files working but some are not
- WordPress Javascript Widget jQuery Dependency Issue
- How do I get my nav menu to show sub pages?
- Animated Accordion [closed]
- Can’t find function which is called in a wordpress theme
- iOS and ajaxComplete
- Function to filter numbers from string
- How to properly use jsPDF library
- How do I link a JavaScript file to a HTML file?
- How do I check whether a checkbox is checked in jQuery?
- ReferenceError: $ is not defined
- How do I check whether a checkbox is checked in jQuery?
- jQuery document.createElement equivalent?
- Pure JavaScript equivalent of jQuery’s $.ready() – how to call a function when the page/DOM is ready for it [duplicate]
- Automatically pausing html5 video as the ‘next’ button is pressed (javascript/ jquery)
- How can I scroll to an element using jQuery?
- jQuery.click() vs onClick
- jQuery Get Selected Option From Dropdown
- Check if checkbox is checked with jQuery
- How to add jQuery code into HTML Page
- How can I get the data-id attribute?
- Check if checkbox is checked with jQuery
- Bootstrap Dropdown menu is not working
- jquery SlideToggle effect in upward direction?
- Change Background color (css property) using Jquery
- Failed to load resource: net::ERR_FILE_NOT_FOUND loading json.js
- Get class name using jQuery
- JavaScript runtime error: ‘$’ is undefined
- Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser
- Set timeout for ajax (jQuery)
- Use images like checkboxes
- How to read xml file contents in jQuery and display in html elements?
- JavaScript Loading Screen while page loads
- Jquery swipe left or right on mobile
- How to move an element into another element?
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- Create table with jQuery – append
- How to convert selected HTML to Json?
- How to Open New window on every Click
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- How can I select an element by name with jQuery?
- jQuery disable/enable submit button
- Play an audio file using jQuery when a button is clicked
- How to move an element after another element using JS or jquery?
- Why is the jquery script not working?
- document.getElementsByClassName().innerHTML always returns “undefined”
- Jquery button click() function is not working
- How to make a simple image upload using Javascript/HTML
- HTML text input allow only numeric input
- Refresh/reload the content in Div using jquery/ajax
- How do I check whether a checkbox is checked in jQuery?
- Print the contents of a DIV
- Embedding instagram webpage inside an iframe
- How to get height of div in px dimension
- Set value to currency in
- jQuery: Uncaught Error: Syntax error, unrecognized expression
- Creating a div element in jQuery
- SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
- How to use in jQuery :not and hasClass() to get a specific element without a class
- HTML Entity Decode
- How to display raw JSON data on a HTML page
- Clearing my form inputs after submission
- Get class list for element with jQuery
- Reload an iframe with jQuery
- How to scroll an HTML page to a given anchor
- Highlight a word with jQuery
- How to call a webservice method from an html page [javascript] with out refresh the page
- Javascript – ERR_CONTENT_LENGTH_MISMATCH
- How do I refresh a DIV content?