F-y-o-d-o-r
7/5/2018 - 11:47 AM

js + jquery - change on window resize + move DOM element

js + jquery - change on window resize + move DOM element

  function changeSearchCityPosition() {
    if ($(window).width() < 767) {
      $('.city-search').appendTo($('.find-studio__adaptive-find'));
    } else {
      $('.city-search').appendTo($('#city-search'));
    }
  }
  //insertAfter

  changeSearchCityPosition();

  $(window).resize(
    function () {
      changeSearchCityPosition();
    }
  )