You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
945 B

  1. import $ from 'jquery';
  2. function moveTestimonialImage() {
  3. $('.has-sidebar .image-text').each(function () {
  4. var $container = $(this);
  5. var $image = $container.children('.image-text--image');
  6. var $firstParagraph = $container.find('.image-text--text blockquote > p:first-child');
  7. if ($image.length === 0) return;
  8. if ($(window).width() < 768) {
  9. // Nur verschieben, wenn noch nicht verschoben
  10. if (!$image.data('moved')) {
  11. $firstParagraph.after($image);
  12. $image.data('moved', true);
  13. }
  14. } else {
  15. // Nur zurück verschieben, wenn verschoben wurde
  16. if ($image.data('moved')) {
  17. $container.prepend($image);
  18. $image.data('moved', false);
  19. }
  20. }
  21. });
  22. }
  23. $(document).ready(function () {
  24. moveTestimonialImage();
  25. });
  26. $(window).on('resize', moveTestimonialImage);