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
- jQuery document.createElement equivalent?
- Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- Create table with jQuery – append
- Play an audio file using jQuery when a button is clicked
- How do I check whether a checkbox is checked in jQuery?
- Clearing my form inputs after submission
- Reload an iframe with jQuery
- How to change the text of a label?
- Using “×” word in html changes to ×
- Changing the selected option of an HTML Select element
- How to scroll to top of page with JavaScript/jQuery?
- How to enable button onClick functions and java script in wordpress post
- Where and how to put inline js in pages
- WordPress Ajax always returns a 404 error
- How to Acheive the custom woocommerce category template
- Hide some items from Screen options in dashboard for products
- Creating loop within functions.php
- Click loads template via ajax
- Adding JavaScript to a WordPress website
- WooCommerce – Reset quantity input field when variation changes
- Using Schema with `the_excerpt`
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- dynamic dependent select dropdown
- Ajaxify This Code
- Remove the product category module block from the Woocommerce product page
- How to change the order of Jquery in the footer of my theme?
- jQuery – Automatic event trigger does not **really** check my form
- Attempt to change jQuery version caused White Screen of Death
- Noscript not working as it should in wordpress site
- Functions when woocommerce isn’t installed
- Adding javascript to functions.php causes problems with my template
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Loading two different AJAX requests on two different pages
- Woocommerce image sizes missing from Appearance › Customize but not declared by theme
- Way to redirect all Product Sub Category to its Main category Page?
- Javascript not loading after the document ready
- Adding product to WooCommerce cart [closed]
- Call javascript functions from each page
- Execute PHP code only with specific user role
- How to hide content on mobile in the functions.php file – woocommerce
- WordPress User Meta value variable into Google Gauge Chart
- PHP function for horizontal Woocommerce thumbnails and badges
- Overriding inline !important CSS with Javscript code snippet with media query
- Running javascript without hooking wp_head
- Remove text after a dot and a colon in Woocommerce product title
- Remove clickable Link of WordPress Site Logo from Woocommerce Single Product page
- Problems adding a new field to product in cart
- Getting click on item to open closest relevant element (popup) with jQuery
- Retrieve Woocommerce Cart Url with javascript/jquery [closed]
- How to use `foreach()` in ajax call
- Variable function names
- WordPress load javascript file if something… (after the page is loaded)
- WordPress Ajaxifying not working properly
- WordPress Jquery+scripts enqueue issue
- Insert menu into theme location depending on user logged in/out status
- Moving CDN jQuery to footer does not work?
- Adding a jQuery rotator function
- Possible jquery / library conflict in plugin usage
- reusing code in function and running it with loop
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- comment_post function with js not running
- sort by date in users