jquery

Refresh the page once when media query is triggered?

坚强是说给别人听的谎言 提交于 2021-02-20 01:38:17
问题 I want to use jQuery to trigger a page refresh, only once, when a media query has been triggered. This is how I detect my media query: function media_query(obj) { size = obj(); if (size != currentSize) { if (size == 'mobile') { location.reload(); currentSize = 'mobile'; } if (size == 'tablet') { location.reload(); currentSize = 'tablet'; } if (size == 'laptop') { currentSize = 'laptop'; } } }; $(window).resize(_.debounce(function () { media_query(mqCSS); }, 10)); $(window).load(function () {

Refresh the page once when media query is triggered?

孤街醉人 提交于 2021-02-20 01:35:27
问题 I want to use jQuery to trigger a page refresh, only once, when a media query has been triggered. This is how I detect my media query: function media_query(obj) { size = obj(); if (size != currentSize) { if (size == 'mobile') { location.reload(); currentSize = 'mobile'; } if (size == 'tablet') { location.reload(); currentSize = 'tablet'; } if (size == 'laptop') { currentSize = 'laptop'; } } }; $(window).resize(_.debounce(function () { media_query(mqCSS); }, 10)); $(window).load(function () {

Using AJAX to load more products WooCommerce

做~自己de王妃 提交于 2021-02-20 00:45:33
问题 I am using AJAX to load more products on a WooCommerce archive. I have used AJAX to "Load More" once before on this page. I have used the same code for the most part, just altered the WP_Query arguments to suit my needs. I can't understand why my code doesn't work. JS /** * AJAX Load (Lazy Load) events */ $('#load-more').click( function(e){ e.preventDefault(); ajax_next_posts() $('body').addClass('ajaxLoading'); }); var ajaxLock = false; // ajaxLock is just a flag to prevent double clicks and

Using AJAX to load more products WooCommerce

别说谁变了你拦得住时间么 提交于 2021-02-20 00:44:34
问题 I am using AJAX to load more products on a WooCommerce archive. I have used AJAX to "Load More" once before on this page. I have used the same code for the most part, just altered the WP_Query arguments to suit my needs. I can't understand why my code doesn't work. JS /** * AJAX Load (Lazy Load) events */ $('#load-more').click( function(e){ e.preventDefault(); ajax_next_posts() $('body').addClass('ajaxLoading'); }); var ajaxLock = false; // ajaxLock is just a flag to prevent double clicks and

Using AJAX to load more products WooCommerce

拥有回忆 提交于 2021-02-20 00:42:49
问题 I am using AJAX to load more products on a WooCommerce archive. I have used AJAX to "Load More" once before on this page. I have used the same code for the most part, just altered the WP_Query arguments to suit my needs. I can't understand why my code doesn't work. JS /** * AJAX Load (Lazy Load) events */ $('#load-more').click( function(e){ e.preventDefault(); ajax_next_posts() $('body').addClass('ajaxLoading'); }); var ajaxLock = false; // ajaxLock is just a flag to prevent double clicks and

Wordpress Posts odd/even Li layout

你说的曾经没有我的故事 提交于 2021-02-19 23:51:27
问题 I am working on a custom theme and on one of the pages i need to style the posts pages as follows: http://gyazo.com/e1f7cfc03c7ba3981188077afcdf0314 The grey box is an image and the red box is content. I need to use perhaps an odd/even Li/Ul pseudo class/selector but i have no idea how to do it. Could anyone offer me a way to start it up? I was thinking of using the Odd/Even pseudo class on UL to change the divs names however i can't think how to do it or where to start. Thanks! Edit: I am

Wordpress Posts odd/even Li layout

瘦欲@ 提交于 2021-02-19 23:49:51
问题 I am working on a custom theme and on one of the pages i need to style the posts pages as follows: http://gyazo.com/e1f7cfc03c7ba3981188077afcdf0314 The grey box is an image and the red box is content. I need to use perhaps an odd/even Li/Ul pseudo class/selector but i have no idea how to do it. Could anyone offer me a way to start it up? I was thinking of using the Odd/Even pseudo class on UL to change the divs names however i can't think how to do it or where to start. Thanks! Edit: I am

After second slide indicator next slide indicator not activate

China☆狼群 提交于 2021-02-19 20:58:00
问题 Can you find out what's wrong with below jquery code. I created Mouse wheel horizontal scroll slider and when scrolling all slides scrolls well and 2nd indicator div activate but not next 3 and 4. $('.slide-container').on('mousewheel DOMMouseScroll', function(event){ var delta = Math.max(-1, Math.min(1, (event.originalEvent.wheelDelta || -event.originalEvent.detail))); $(this).animate({scrollLeft:( $(this).scrollLeft() - ( delta * $('.slide').innerWidth() ) )},400, 'easeInCirc'); event

After second slide indicator next slide indicator not activate

我们两清 提交于 2021-02-19 20:54:31
问题 Can you find out what's wrong with below jquery code. I created Mouse wheel horizontal scroll slider and when scrolling all slides scrolls well and 2nd indicator div activate but not next 3 and 4. $('.slide-container').on('mousewheel DOMMouseScroll', function(event){ var delta = Math.max(-1, Math.min(1, (event.originalEvent.wheelDelta || -event.originalEvent.detail))); $(this).animate({scrollLeft:( $(this).scrollLeft() - ( delta * $('.slide').innerWidth() ) )},400, 'easeInCirc'); event

Add button on header (th) to hide and show filter control in bootstrap table

雨燕双飞 提交于 2021-02-19 11:25:15
问题 I am using bootstrap table with filter control. I want to be able to add a button(icon) on each of my th's to hide and show the filter control. Is there a way to do that? This is an example on bootstrap table: https://live.bootstrap-table.com/example/extensions/filter-control.html As you can see the filter control takes up a lot of place on the header. I just wanted to see if it was possible to only add the filter control by adding an icon on the header that adds the filter control on click