{"id":985471,"date":"2015-07-10T12:13:39","date_gmt":"2015-07-10T19:13:39","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/"},"modified":"2015-07-15T08:37:12","modified_gmt":"2015-07-15T15:37:12","slug":"scroll-to-div-on-filter-view-as-change","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/","title":{"rendered":"Scroll To Div on Filter &#039;View As&#039; Change"},"content":{"rendered":"<p>Hello,<\/p>\n<p>We are in development now and our home page has a list of featured events (using the events widget) and then has the filter bar with the &#8216;photo&#8217; view set as default.  We enabled (2) other views (MAP &amp; MONTH).<\/p>\n<p>The issue we have is when we change the &#8216;View As&#8217; to MAP or MONTH the page refreshes and we are then at the top of the page again, so the user needs to scroll down to see the changed view.<\/p>\n<p>Obviously this is not a bug and is the correct functionality, but is there a way to scroll to the appropriate anchor when the view is changed so the user doesn&#8217;t get confused as to why they changed views and don&#8217;t see the changed view immediately?<\/p>\n<p>I can use jQuery and check if the body has a class (ie. tribe-events-map) and if so, scroll to the appropriate part of the page.  This works fine, but using this technique means anyone who hits the landing page would be scrolled to the same div as if they changed to the &#8216;photo view&#8217; since the default &#8216;tribe-events-photo&#8217; class is being used on the home page due to the default view being photo.<\/p>\n<p>Any suggestions?<\/p>\n<p>Thanks in advance.<\/p>\n","protected":false},"template":"","class_list":["post-985471","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Scroll To Div on Filter &#039;View As&#039; Change -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scroll To Div on Filter &#039;View As&#039; Change -\" \/>\n<meta property=\"og:description\" content=\"Hello, We are in development now and our home page has a list of featured events (using the events widget) and then has the filter bar with the &#8216;photo&#8217; view set as default. We enabled (2) other views (MAP &amp; MONTH). The issue we have is when we change the &#8216;View As&#8217; to MAP or [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-07-15T15:37:12+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/\",\"name\":\"Scroll To Div on Filter &#039;View As&#039; Change -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-07-10T19:13:39+00:00\",\"dateModified\":\"2015-07-15T15:37:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Scroll To Div on Filter &#039;View As&#039; Change\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Scroll To Div on Filter &#039;View As&#039; Change -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/","og_locale":"en_US","og_type":"article","og_title":"Scroll To Div on Filter &#039;View As&#039; Change -","og_description":"Hello, We are in development now and our home page has a list of featured events (using the events widget) and then has the filter bar with the &#8216;photo&#8217; view set as default. We enabled (2) other views (MAP &amp; MONTH). The issue we have is when we change the &#8216;View As&#8217; to MAP or [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/","article_modified_time":"2015-07-15T15:37:12+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/","name":"Scroll To Div on Filter &#039;View As&#039; Change -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-07-10T19:13:39+00:00","dateModified":"2015-07-15T15:37:12+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/scroll-to-div-on-filter-view-as-change\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Scroll To Div on Filter &#039;View As&#039; Change"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/985471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/985471\/revisions"}],"predecessor-version":[{"id":985591,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/985471\/revisions\/985591"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=985471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}