diff --git a/Drupal Snippets.md b/Drupal Snippets.md index 9a3d23b..ebb414b 100644 --- a/Drupal Snippets.md +++ b/Drupal Snippets.md @@ -6,3 +6,13 @@ {{ dump(_context) }} {# /my dubugger #} + +## Moving blocks based on screen size using JS +jQuery(window).on('resize', function () { + if (jQuery(window).width() <= 768) { + console.log( "yippee!!!" ); + jQuery('#my-block').appendTo('#mobile-region'); + } else { + jQuery('#my-block').appendTo('#desktop-region'); + } +});