Guest User

Untitled

a guest
May 1st, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. function rtl_columns_fix(){
  2. ?>
  3. <script>
  4. (function($){
  5.  
  6. var resizeTimeout, sortedReverse = false;
  7. $(window).resize(function () {
  8. if (resizeTimeout) {
  9. window.clearTimeout(resizeTimeout);
  10. }
  11. resizeTimeout = window.setTimeout(function () {
  12. var windowWidth = window.innerWidth;
  13. if ((windowWidth < 767 && !sortedReverse) || (windowWidth >= 767 && sortedReverse)) {
  14.  
  15. var rtlContainer = $('.entry-content-wrapper, #footer .container');
  16.  
  17. rtlContainer.each(function(){
  18. var rtlCols = $(this).children('.flex_column').not('.av_one_full');
  19. $(this).append(rtlCols.get().reverse());
  20. });
  21.  
  22. sortedReverse = !sortedReverse;
  23. }
  24. }, 100);
  25. }).trigger("resize");
  26.  
  27. })(jQuery);
  28.  
  29. </script>
  30. <?php
  31. }
  32. if(is_rtl()) {
  33. add_action('wp_footer', 'rtl_columns_fix');
  34. }
Advertisement
Add Comment
Please, Sign In to add comment