From 62ab1ba33133a172f386647d04407eec9a1bfcad Mon Sep 17 00:00:00 2001 From: rdrew Date: Tue, 24 Jun 2025 11:23:30 -0300 Subject: [PATCH] [nb] Edit: Drupal Snippets.md --- Drupal Snippets.md | 10 ++++++++++ 1 file changed, 10 insertions(+) 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'); + } +});