<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Anchor Link Scroll Effect in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/176354#M4589</link>
    <description>&lt;P&gt;Hey again&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/53318"&gt;@lisannebuisman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i tried coming up with a few solutions for you, but first here is the &lt;A href="https://knowledge.hubspot.com/articles/kcs_article/cta/can-i-use-an-anchor-id-in-the-url-link-of-a-hubspot-call-to-action-button" target="_self"&gt;Knowledge article&lt;/A&gt; that confirms what can and can't be put in the CTA fields. I think i've come up with a 3 possible solutions for you, each having their own pros/cons depending on your skillset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;First Solution (easiest&lt;/STRONG&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You leave the button as is, with the [url]#anchor_id, the reload isn't going to be the end-all-be-all of ux issues, but I do understand that it is a little annoying.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Pros:&lt;/STRONG&gt; It's built in and the cta works as designed&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Cons:&lt;/STRONG&gt; Will create a slightly annoying UX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Second&amp;nbsp;Solution (easy):&lt;/STRONG&gt;&lt;BR /&gt;You can just hardcode the demo button into the section using plain HTML&lt;/P&gt;
&lt;PRE&gt;&amp;lt;span class="hs-cta-node hs-cta-11420eeb-d4ce-4169-9ff3-84be0e6db6a8" id="hs-cta-11420eeb-d4ce-4169-9ff3-84be0e6db6a8" style="visibility: visible;" data-hs-drop="true"&amp;gt;
&amp;lt;a id="cta_button_1794004_0d52d041-2aa9-45a5-810b-a198a4a3a07e" class="cta_button " href="#your_link_id" style="" cta_dest_link="https://app.hubspot.com/meetings/info11760" title="Demo wanneer het jou uitkomt"&amp;gt;
&amp;lt;strong&amp;gt;
&amp;lt;span style="font-size: 15px;"&amp;gt;Demo wanneer het jou uitkomt&amp;lt;/span&amp;gt;&amp;lt;/strong&amp;gt;
&amp;lt;/a&amp;gt;
&amp;lt;/span&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Some pros an cons of this soution:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Pros:&lt;/STRONG&gt;&amp;nbsp;No extra scripting needed, just a simple hardcoded button.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Cons:&lt;/STRONG&gt; I don't think you'll be able to see the tracking – You may be able to hack it together where the ids match and HubSpot sees it by clicks on said ID, but I don't know that for sure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Third Solution&amp;nbsp;(Probably the hardest of these solutions):&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You could write some custom javascript to replace the href of that specific button on page load. For example:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;script&amp;gt;
$( document ).ready(function() {
   $('#your_cta').attr('href', '#your_anchor_id');

});
&amp;lt;/script&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Pros:&amp;nbsp;&lt;/STRONG&gt;If you know JS, it's easy to edit/implement&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Cons:&amp;nbsp;&lt;/STRONG&gt;You most likely won't get the tracking info, if you don't know JS, you may have a hard time implementing/updating it. Creating 1-off solutions just overcome something like this (which is working as designed) isn't usualy the best idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally, what I would try first is to get the&amp;nbsp;&lt;STRONG&gt;exact&lt;/STRONG&gt; html code that makes your button and try hardcoding it into the templat with just the #anchor-id as your 'href'. Then do a couple tests to see if you can get it to track the click. – If it does, then I'd say go that route.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Hopefully one of these ideas helps you out and gets you on the right track, let me know if you have any other questions!&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2018 17:18:35 GMT</pubDate>
    <dc:creator>Ty</dc:creator>
    <dc:date>2018-02-01T17:18:35Z</dc:date>
    <item>
      <title>Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/1482#M155</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to create a one page website.&amp;nbsp;At the top of the page,&amp;nbsp;I place a horizontal menu with some&amp;nbsp;anchor links.&amp;nbsp;When a user clicks on one of these,&amp;nbsp;will arrive on a specific section of the page with a&amp;nbsp;scroll effect.&amp;nbsp;&lt;BR /&gt;Can I create a similar effect in a Website Page in Hubspot?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 14:56:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/1482#M155</guid>
      <dc:creator>Vanessa_megg</dc:creator>
      <dc:date>2016-11-25T14:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/1558#M160</link>
      <description>&lt;P&gt;yep. In a Rich Text module there is an option under the insert menu titled "anchor" that will place an ID on an empty "a" tag. Then you just need to link to that name the usual way - #linktoname.&lt;/P&gt;
&lt;P&gt;You may also want to add smooth scrolling with this javascript&amp;amp;colon;&amp;nbsp;&lt;A href="https://css-tricks.com/snippets/jquery/smooth-scrolling/" target="_blank" rel="noopener"&gt;https://css-tricks.com/snippets/jquery/smooth-scrolling/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 12:39:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/1558#M160</guid>
      <dc:creator>stefen</dc:creator>
      <dc:date>2020-10-29T12:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/1559#M161</link>
      <description>&lt;P&gt;Hi Vanessa,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the sound of it, it sounds like you're looking for a smooth scrolling effect. This can be down easily with just a little bit of jQuery.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can insert this snippet into your JS file, or the head-tag of your template:&lt;/P&gt;
&lt;PRE&gt;$(document).ready(function(){
	$('a[href^="#"]').on('click',function (e) {
	    e.preventDefault();

	    var target = this.hash,
	    $target = $(target);

	    $('html, body').stop().animate({
	        'scrollTop': $target.offset().top
	    }, 900, function () {
	        window.location.hash = target;
	    });
	});
});&lt;/PRE&gt;
&lt;P&gt;What this snippet does is that it looks for any of your href's that include the hash(#) and uses `e.preventDefault()` to prevent the typical linking function. Which&amp;nbsp;then allows you to add an animate to use as the new linking function. As long as you have a link with a hash (ie: &amp;lt;a href="#link1"&amp;gt;Link 1&amp;lt;/a&amp;gt;) and a div with a coresponding name, (ie: &amp;lt;div id="link1"&amp;gt;Link 1's div&amp;lt;/div&amp;gt;), this function will fire. You can also see a quick example I mocked up for you &lt;A href="https://jsfiddle.net/zj1em30a/" target="_self"&gt;here on JSFiddle.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An important thing to note is that you can change the speed of the animation by changing the `900` in the function, this number works in "ms", so 900 is actually 900ms. This speed defines how long the whole animation will last.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;-- Ty&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 14:26:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/1559#M161</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2016-11-28T14:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/19829#M1868</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have added anchor tag to my&amp;nbsp;&lt;A href="http://seerion-2310098.hs-sites.com/seerionlanding" target="_blank"&gt;http://seerion-2310098.hs-sites.com/seerionlanding&lt;/A&gt; on section about the event. I have named the anchor as #about. Dont know where I am going wrong. But then I went in my advanced menu option and&amp;nbsp;in the linking to page option i just entered&amp;nbsp;#about . But when I actually click on about on my menu , it just displays blank.&lt;/P&gt;&lt;P&gt;Can you please tell me where m i going wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 18:14:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/19829#M1868</guid>
      <dc:creator>poojanadkarni1</dc:creator>
      <dc:date>2017-06-21T18:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/19840#M1869</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/11332"&gt;@poojanadkarni1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry you're having trouble with this, I took a look at your page and I noticed your link at the top "About The Event" is linking to "&lt;SPAN&gt;//seerion-2310098.hs-sites.com/seerionlanding/#about". What is happening here is that it is reloading the page and then taking you to the&amp;nbsp;section with the id of "about".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For starters, change your link to just say '&lt;STRONG&gt;#about&lt;/STRONG&gt;'. What will happen now is your browser will register that click and append '#about' into the url. There won't be a page refresh so it should just take you directly to the section.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As far as the scroll animation, I couldn't find where you were including the script. Could you clarify for me what file it was placed in? Your console isn't throwing any errors, but it may not be running correctly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let me know if this fixes your problem!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-- Ty&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 18:48:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/19840#M1869</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2017-06-21T18:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21394#M2069</link>
      <description>&lt;P&gt;Hi Ty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking to do the same thing here. I can't seem to implement this and not quite sure what I'm missing... I've added it to the head but no change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to put the effect on the 'Let's work together' link here:&amp;nbsp;&lt;A href="https://www.zoodigital.com/contact" target="_blank"&gt;https://www.zoodigital.com/contact&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, Jonny&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 11:33:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21394#M2069</guid>
      <dc:creator>JonnyZOO</dc:creator>
      <dc:date>2017-07-05T11:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21401#M2072</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/12328"&gt;@JonnyZOO&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ended up rewriting this over the weekend to make it a little more compact, you could try replacing the original code with&amp;nbsp;this instead.&lt;/P&gt;
&lt;PRE&gt;$(document).on('click', 'a', function(event){
    event.preventDefault();

    $('html, body').animate({
        scrollTop: $( $.attr(this, 'href') ).offset().top
    }, 500);
});&lt;/PRE&gt;
&lt;P&gt;Then change the&amp;nbsp;&lt;STRONG&gt;500&lt;/STRONG&gt; to adjust speed. Remember when using animate in jQuery the numbers are read in milliseconds. So 1000 would be a 1-second scroll effect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this works for you!&lt;/P&gt;
&lt;P&gt;-- Ty&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 12:41:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21401#M2072</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2017-07-05T12:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21408#M2073</link>
      <description>&lt;P&gt;Hi Ty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply. I've added&amp;nbsp;this code to the custom head but I'm getting a message of 'There is invalid markup in your custom head'.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screen Shot 2017-07-05 at 14.27.43.png" style="width: 790px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/4071i9E18FCBDA8D32E91/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2017-07-05 at 14.27.43.png" alt="Screen Shot 2017-07-05 at 14.27.43.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, Jonny&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 13:32:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21408#M2073</guid>
      <dc:creator>JonnyZOO</dc:creator>
      <dc:date>2017-07-05T13:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21411#M2074</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/12328"&gt;@JonnyZOO&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I updated your header, but it was because you forgot to wrap the script in script tags. Anytime you place javascript into what is considered an HTML file, such as the head, or body of a page, you will need to tell the browser that the following text is to be read as a javascript command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-07-05 at 9.34.50 AM.png" style="width: 734px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/4072i1509A04DABC6D158/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2017-07-05 at 9.34.50 AM.png" alt="Screen Shot 2017-07-05 at 9.34.50 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I checked your page and it seems to be working now, let me know how it looks on your end!&lt;/P&gt;
&lt;P&gt;-- Ty&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 13:37:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21411#M2074</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2017-07-05T13:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21421#M2075</link>
      <description>&lt;P&gt;Awesome, good stuff Ty - thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 13:59:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/21421#M2075</guid>
      <dc:creator>JonnyZOO</dc:creator>
      <dc:date>2017-07-05T13:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23630#M2267</link>
      <description>&lt;P&gt;Thank you for sharing this code. I have added it to&amp;nbsp;the header of a landing page template, but now any other links on the page (logo in nav and social buttons in footer)&amp;nbsp;don't go anywhere when you try and click on them. If you&amp;nbsp;hover&amp;nbsp;over the logo or icons, it shows the web address that it should be doing to. The jss code is blocking the links for some reason. Any way to fix this? Is there a way to apply that code only to that specific button?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the page where I am having the issue. The "Save my seat" button in the banner image works, but no other links are clickable -&amp;nbsp;&lt;A href="http://www.alignex.com/mechfuse-2017" target="_blank"&gt;http://www.alignex.com/mechfuse-2017&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 16:12:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23630#M2267</guid>
      <dc:creator>leckerman</dc:creator>
      <dc:date>2017-07-24T16:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23643#M2269</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13654"&gt;@leckerman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to explain this code a little better, this was for a specific use case where someone didn't have other anchor tags on their page, so we were able to target their link by just using the `a` tag. When you introduce more links to a page, such as social, it needs a little more scoping.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll break this code down user colors:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$(document).on(&lt;FONT color="#0000FF"&gt;'click'&lt;/FONT&gt;, &lt;FONT color="#FF0000"&gt;'a'&lt;/FONT&gt;, function(&lt;FONT color="#339966"&gt;event&lt;/FONT&gt;){
    &lt;FONT color="#339966"&gt;event.preventDefault();&lt;/FONT&gt;
});&lt;/PRE&gt;
&lt;P&gt;So here is the basic declaration we are calling.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;Blue&lt;/FONT&gt; is your action, how you will trigger the event&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Red&lt;/FONT&gt; is your target, what will be triggering this event&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;Green&lt;/FONT&gt; is your functions arguments/params&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So let's take a look at what's happening, essentially this function is read as&lt;/P&gt;
&lt;P&gt;"After load, when the &lt;FONT color="#FF0000"&gt;target&lt;/FONT&gt; is &lt;FONT color="#0000FF"&gt;clicked,&amp;nbsp;&lt;/FONT&gt;do the code in the function. Now let's look at our &lt;FONT color="#339966"&gt;params&lt;/FONT&gt; we set. We're catching the 'event'. A default event for an &amp;lt;a&amp;gt; is to take you to their href="" value. That's what this line is in there for.&lt;/P&gt;
&lt;PRE&gt;    &lt;FONT color="#339966"&gt;event.preventDefault();&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;With this line we are basically telling the page on clicking an 'a' tag, to not let it take you to it's proposed href value. (even if you're using a dummy link, such as '#').&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Your Solution&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For this use case, I would suggest writing a class name on the button you need clicked, such as '.scroll-cta' and replacing the 'a' with that. That way, you're code is only scoped to that specific class, and you don't have to worry about having multiple a-tags or links on a page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your new code would look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$(document).on('click', '.your-new-btn-class', function(event){
    event.preventDefault();
    $('html, body').animate({
         scrollTop: $( $.attr(this, 'href') ).offset().top
     }, 500);
});&lt;/PRE&gt;
&lt;P&gt;Try this and let me know how it goes, if it's still not working, it will help narrow down what could be going wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps!&lt;/P&gt;
&lt;P&gt;-- Ty&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 16:41:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23643#M2269</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2017-07-24T16:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23689#M2272</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/131"&gt;@Ty&lt;/a&gt;! I can't seem to make it work using&amp;nbsp;a class name instead of "a". Does a new&amp;nbsp;class have to be added and called out on the&amp;nbsp;css document that is linked to the template or can I just use a class that was already in the&amp;nbsp;rich text module, like below? I tried the below code and also tried creating a new class called "scroll-btn" that isn't called out in the css doc, but neither worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This code is in a rich text module and the class "btn" was previously defined&amp;nbsp;to style the button. I didn't make a new class name. I am not using&amp;nbsp;it as a CTA.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;p&amp;gt;&amp;lt;span class="btn"&amp;gt;&amp;lt;a href="#savemyseat" style="text-decoration: none;"&amp;gt;SAVE MY SEAT&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This code&lt;SPAN&gt;&amp;nbsp;is the the head of the template under "Additional HTML Head Markup for this Layout"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;$(document).on('click', '.btn', function(event){&lt;BR /&gt;event.preventDefault();&lt;/P&gt;&lt;P&gt;$('html, body').animate({&lt;BR /&gt;scrollTop: $( $.attr(this, 'href') ).offset().top&lt;BR /&gt;}, 500);&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 19:09:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23689#M2272</guid>
      <dc:creator>leckerman</dc:creator>
      <dc:date>2017-07-24T19:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23692#M2273</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13654"&gt;@leckerman&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alright, I see you issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you have it set up so when you click the class of 'btn', it prevents the default event (which should be linking it to your #id).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, you're html doesn't have an &amp;lt;a&amp;gt; tag with the class of 'btn'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;span class="btn"&amp;gt;&amp;lt;a href="#savemyseat" style="text-decoration: none;"&amp;gt;SAVE MY SEAT&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&lt;/PRE&gt;
&lt;P&gt;So what you need to do is scope your actions down so that your trigger is clicking the href.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can be done in 2 different ways, editing the script, or editing the html.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Editing your script&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$(document).on('click', '.btn a', function(event){ });&lt;/PRE&gt;
&lt;P&gt;By adding '.btn a' you are telling your script&amp;nbsp;to only execute your function when you click the &amp;lt;a&amp;gt; child within the '.btn' parent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Editing your HTML&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;span class="btn"&amp;gt;&amp;lt;a href="#savemyseat" class="link-btn" style="text-decoration: none;"&amp;gt;SAVE MY SEAT&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&lt;/PRE&gt;
&lt;P&gt;You can add a new class in your html on your &amp;lt;a&amp;gt; tag to handle this function as well, I used 'link-btn' for a naming convention, but feel free to use whatever you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then remember to adjust your function command accordingly&lt;/P&gt;
&lt;PRE&gt;$(document).on('click', '.link-btn', function(event){ });
&lt;/PRE&gt;
&lt;P&gt;Either of these solutions should fix your issues, let me know if you're still having some trouble!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-- Ty&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 19:21:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23692#M2273</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2017-07-24T19:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23694#M2274</link>
      <description>&lt;P&gt;You did it &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/131"&gt;@Ty&lt;/a&gt;! All fixed. Thank you so much for your help and for taking the time to explain why too. That was VERY helpful!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 19:26:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/23694#M2274</guid>
      <dc:creator>leckerman</dc:creator>
      <dc:date>2017-07-24T19:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/25944#M2445</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/131"&gt;@Ty&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea why the following javascript that makes my mobile navigation work is preventing my anchor scroll buttons to work on mobile? If I remove any navigation and the below javascript that is embeded in a custom HTML module at the bottom of the template, the buttons work in mobile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example of a page below.&amp;nbsp;I had to create a mobile button (hide on desktop) and a desktop button (hide on mobile) for each page if I want to use the scroll javascript on desktop.&amp;nbsp;&lt;BR /&gt;&lt;A href="http://www.alignex.com/mechfuse-2017" target="_blank"&gt;http://www.alignex.com/mechfuse-2017&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;/*-------------------------------------------------------------------------------*/&lt;BR /&gt;/* MOBILE NAV - TOGGLE SIDE MENU&lt;BR /&gt;/*-------------------------------------------------------------------------------*/&lt;BR /&gt;$(function() {&lt;/P&gt;&lt;P&gt;// Prepend a mobile icon to the header&lt;BR /&gt;$(".custom-menu-primary").after('&amp;lt;a class="mobile-icon"&amp;gt;&amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');&lt;BR /&gt;&lt;BR /&gt;// Prepend a close icon to the menu&lt;BR /&gt;$(".custom-menu-primary .hs-menu-flow-horizontal&amp;gt;ul").before('&amp;lt;a class="close-icon"&amp;gt;&amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;');&lt;BR /&gt;&lt;BR /&gt;// Add body class on mobile icon click&lt;BR /&gt;$(".mobile-icon, .close-icon").click(function(){&lt;BR /&gt;$("body").toggleClass("show-mobile-nav ");&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;// Dropdown sub menu&lt;BR /&gt;$(&lt;BR /&gt;".hs-menu-depth-1.hs-item-has-children"&lt;BR /&gt;).not(".active-branch:nth-child(2)").click(function() {&lt;BR /&gt;$(this).toggleClass("drop");&lt;BR /&gt;$(this).find("&amp;gt; ul").toggle();&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;// Set the menu height to 100% of the document&lt;BR /&gt;function setMenuHeight(){&lt;BR /&gt;var height = $(document).outerHeight(true);&lt;BR /&gt;$(".custom-menu-primary").height(height);&lt;BR /&gt;}&lt;BR /&gt;setMenuHeight();&lt;BR /&gt;&lt;BR /&gt;// Wrap body contents with a div so the transforms will work&lt;BR /&gt;$('body&amp;gt; div').find('script:not(script[type="IN/Share"])').remove().end().wrapAll('&amp;lt;div id="site-wrapper"&amp;gt;&amp;lt;/div&amp;gt;');&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 18:51:40 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/25944#M2445</guid>
      <dc:creator>leckerman</dc:creator>
      <dc:date>2017-08-18T18:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/27188#M2625</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13654"&gt;@leckerman&lt;/a&gt;, took me a minute, but I think i have a solution for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alright, so first thing is, I noticed you weren't using the same button from desktop to mobile. You have two parent divs&amp;nbsp;&lt;STRONG&gt;.hide-on-mobile&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;.hide-on-desktop&lt;/STRONG&gt;.&amp;nbsp;Since you have 2 buttons, only one of them had the class&amp;nbsp;&lt;STRONG&gt;'.link-scroll'&lt;/STRONG&gt; on it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hopped into your portal and added the class on the mobile version, that's step 1. Step 2 is, when you go into a mobile screensize, you are adding this css code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;@media (max-width: 1024px)
body, html {
     height: 100%; 
}&lt;/PRE&gt;
&lt;P&gt;For this Javascript to work, you will need to remove the '&lt;STRONG&gt;height: 100%;&lt;/STRONG&gt;' property.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps you out!&lt;/P&gt;
&lt;P&gt;-- Ty&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 20:42:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/27188#M2625</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2017-08-18T20:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/27291#M2637</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/131"&gt;@Ty&lt;/a&gt;&amp;nbsp;- That does fix the issue, however my navigation on mobile and destktop BOTH disapear when I comment out this code on the css doc...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@media (max-width: 1024px) {&amp;nbsp;&lt;BR /&gt;body, html {&lt;BR /&gt;height: 100%;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I removed the "link-scroll" class on the mobile button, because that was my work-around to try and get the button to at least work as an anchor link. When that class is on the "hide-on-desktop" module (mobile only) the button doesn't work AT ALL. I am leaving it as is for now, but will need to take it off sometime today if I can't get the issue fixed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions? Thank you!!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 13:13:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/27291#M2637</guid>
      <dc:creator>leckerman</dc:creator>
      <dc:date>2017-08-21T13:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/44141#M3815</link>
      <description>&lt;P&gt;Hey guys&lt;/P&gt;&lt;P&gt;Been trying to get something like this working on my site with no luck thus far. Have worked through the thread trying the proposed solutions and am sure I'm missing something critical but not obvious to me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get the 'FIND OUT MORE - GET IN TOUCH' link on this page to scroll smoothly to an anchor I defined near the top of the page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.adglow.com/web-summit-follow-up?hs_preview=WNNSdvRh-5436505723" target="_blank"&gt;http://www.adglow.com/web-summit-follow-up?hs_preview=WNNSdvRh-5436505723&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have included this script in the head:&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;$(document).on('click', '#top', function(event){&lt;BR /&gt;event.preventDefault();&lt;/P&gt;&lt;P&gt;$('html, body').animate({&lt;BR /&gt;scrollTop: $( $.attr(this, 'href') ).offset().top&lt;BR /&gt;}, 500);&lt;BR /&gt;});&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And have set up the link like this:&lt;/P&gt;&lt;P&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;a href="#top"&amp;gt;FIND OUT MORE - GET IN TOUCH NOW&amp;lt;/a&amp;gt;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 13:36:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/44141#M3815</guid>
      <dc:creator>phaslehurst</dc:creator>
      <dc:date>2017-11-21T13:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Anchor Link Scroll Effect</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/44915#M3824</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/9018"&gt;@phaslehurst&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Looking at your code, it seems you're calling your href as if it was an id.&lt;/P&gt;
&lt;P&gt;In the line&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$(document).on('click', '#top', function(event){ }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is saying "On click of element with the id of "top", perform this function". But your button is just an &amp;lt;a&amp;gt; with the href of #top.&lt;/P&gt;
&lt;PRE&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;&amp;lt;a href="#top"&amp;gt;FIND OUT MORE - GET IN TOUCH NOW&amp;lt;/a&amp;gt;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;

&lt;/PRE&gt;
&lt;P&gt;To fix this, you can either add a unique class or id to your &amp;lt;a&amp;gt; then call your function with that element's id or class. So the easiest fix would be changing your text link to this:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;a id="top" href="#top"&amp;gt;FIND OUT MORE - GET IN TOUCH NOW&amp;lt;/a&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;Let me know how this works out for you!&lt;/P&gt;
&lt;P&gt;-- Ty&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 17:10:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Anchor-Link-Scroll-Effect/m-p/44915#M3824</guid>
      <dc:creator>Ty</dc:creator>
      <dc:date>2017-11-21T17:10:06Z</dc:date>
    </item>
  </channel>
</rss>

