<?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: JS tabbed content - On load issues in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212803#M9108</link>
    <description>&lt;P&gt;Quick update:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a look at the page elements and can see display: none; from the .tabcontent&amp;nbsp;class was being overwritten by .row-fluid:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;.row-fluid [class*="span"]&amp;nbsp;{
/* display:&amp;nbsp;block; */
float:&amp;nbsp;left;
width:&amp;nbsp;100%;
min-height:&amp;nbsp;28px;
margin-left:&amp;nbsp;2.127659574%;
margin-left:&amp;nbsp;2.0744680846382977%;
-webkit-box-sizing:&amp;nbsp;border-box;
-moz-box-sizing:&amp;nbsp;border-box;
-ms-box-sizing:&amp;nbsp;border-box;
box-sizing:&amp;nbsp;border-box;
}&lt;/PRE&gt;&lt;P&gt;So I guess the question is, how do&amp;nbsp;I prevent .row-fluid from affecting the script? I can see&amp;nbsp; .row-fluid &lt;A href="https://designers.hubspot.com/docs/cos/the-cos-responsive-grid" target="_self"&gt;sits quite high up on the grid&lt;/A&gt;. I would simply do this but this stops the script from working correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;.tabcontent &amp;gt; .row-fluid-wrapper &amp;gt; .row-fluid {
display: none;
}&lt;/PRE&gt;&lt;P&gt;Adding !important to .tabcontent {display: none} creates a similar issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="styles-section-title styles-selector"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Mon, 22 Oct 2018 15:44:08 GMT</pubDate>
    <dc:creator>Stevie-Kv</dc:creator>
    <dc:date>2018-10-22T15:44:08Z</dc:date>
    <item>
      <title>JS tabbed content - On load issues</title>
      <link>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212789#M9105</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just been messing around with js tabbed content, something I am pretty new to. I went to w3 to get an example &lt;A title="w3schools.com" href="https://www.w3schools.com/howto/howto_js_tabs.asp" target="_self"&gt;(HERE)&lt;/A&gt;&amp;nbsp;and pretty much copied and pasted it over to design manager to play with. Applying .tabcontent classes to&amp;nbsp;content module groups and wrapping the button groups like so:&amp;nbsp;&amp;lt;element onclick="openCity(event, 'London')"&amp;gt;{{ html }}&amp;lt;/element&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only problem I am having is that the page loads and displays each tab's content where I want it to display none at first. The script works otherwise as intended, clicking each button will display that tab's content and hides the rest, it's just that initial issue upon loading the page I can't figure out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've set up a quick dummy LP below:&lt;/P&gt;&lt;P&gt;&lt;A href="http://info.hawktraining.com/-temporary-slug-0e516d27-bd42-4805-ac09-6dde2e4d4401?hs_preview=dscHhiqC-6366334776" target="_blank"&gt;http://info.hawktraining.com/-temporary-slug-0e516d27-bd42-4805-ac09-6dde2e4d4401?hs_preview=dscHhiqC-6366334776&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 15:54:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212789#M9105</guid>
      <dc:creator>Stevie-Kv</dc:creator>
      <dc:date>2018-10-22T15:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: JS tabbed content - On load issues</title>
      <link>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212803#M9108</link>
      <description>&lt;P&gt;Quick update:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a look at the page elements and can see display: none; from the .tabcontent&amp;nbsp;class was being overwritten by .row-fluid:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;.row-fluid [class*="span"]&amp;nbsp;{
/* display:&amp;nbsp;block; */
float:&amp;nbsp;left;
width:&amp;nbsp;100%;
min-height:&amp;nbsp;28px;
margin-left:&amp;nbsp;2.127659574%;
margin-left:&amp;nbsp;2.0744680846382977%;
-webkit-box-sizing:&amp;nbsp;border-box;
-moz-box-sizing:&amp;nbsp;border-box;
-ms-box-sizing:&amp;nbsp;border-box;
box-sizing:&amp;nbsp;border-box;
}&lt;/PRE&gt;&lt;P&gt;So I guess the question is, how do&amp;nbsp;I prevent .row-fluid from affecting the script? I can see&amp;nbsp; .row-fluid &lt;A href="https://designers.hubspot.com/docs/cos/the-cos-responsive-grid" target="_self"&gt;sits quite high up on the grid&lt;/A&gt;. I would simply do this but this stops the script from working correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;.tabcontent &amp;gt; .row-fluid-wrapper &amp;gt; .row-fluid {
display: none;
}&lt;/PRE&gt;&lt;P&gt;Adding !important to .tabcontent {display: none} creates a similar issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="styles-section-title styles-selector"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 22 Oct 2018 15:44:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212803#M9108</guid>
      <dc:creator>Stevie-Kv</dc:creator>
      <dc:date>2018-10-22T15:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: JS tabbed content - On load issues</title>
      <link>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212809#M9111</link>
      <description>&lt;P&gt;add this css to your page&lt;/P&gt;&lt;PRE&gt;.body-container &amp;gt; div:nth-child(n+4) .tabcontent{&lt;BR /&gt; display: none;&lt;BR /&gt;}&lt;/PRE&gt;&lt;HR /&gt;&lt;P&gt;If this answer helped, please, mark as solved &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;tim@belch.io | &lt;A href="https://forms.belch.io" target="_blank"&gt;forms.belch.io&lt;/A&gt; | Design your own Beautiful HubSpot Forms; No coding necessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Drop by and say Hi to me &lt;A href="http://slack.belch.io/" target="_blank"&gt;on slack&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 16:03:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212809#M9111</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-10-22T16:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: JS tabbed content - On load issues</title>
      <link>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212817#M9113</link>
      <description>&lt;P&gt;Thanks Tim, did the job perfectly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it ok if you explain the inner workings to me little? I and maybe others will likely do this in the future so would be good to get an understanding and learn from the experience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure where my second update post went, but I had thought of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;.tabconent &amp;gt; .row-fluid-wrapper &amp;gt; .row-fluid {
display: none;}&lt;/PRE&gt;&lt;P&gt;which prevented the script from displaying as well as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;.tabcontent {
    display: none !important;
}&lt;/PRE&gt;&lt;P&gt;It looks like you simply went the other way, down to the body on the &lt;A href="https://designers.hubspot.com/docs/cos/the-cos-responsive-grid" target="_self"&gt;COS grid&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also don't quite understand the inclusion of nth-child(n+4), this is for 4 and onwards correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2018 16:25:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212817#M9113</guid>
      <dc:creator>Stevie-Kv</dc:creator>
      <dc:date>2018-10-22T16:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: JS tabbed content - On load issues</title>
      <link>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212850#M9121</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/15444"&gt;@Stevie-Kv&lt;/a&gt;&amp;nbsp;- Sure! When I first looked at your page (it's not now)... I did&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$('.tabcontent').length //result was 5&lt;/PRE&gt;&lt;P&gt;But, I only saw 4 tabcontents you wanted hidden, so I figured I would Isolate the 4 a little bit more by targeting the parent container and hiding only the children that contained tabcontent. That's why there was nth-child(n+4)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Monosnap 2018-10-22 14-24-42.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/12614iDB9B86AE54FDBEE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Monosnap 2018-10-22 14-24-42.png" alt="Monosnap 2018-10-22 14-24-42.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, your page structure is now different from when I wrote the code and you only have 4 tabcontent blocks so, the following css should be sufficient&lt;/P&gt;&lt;PRE&gt;div.body-container .tabcontent{
    display: none;
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Oct 2018 18:28:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212850#M9121</guid>
      <dc:creator>tjoyce</dc:creator>
      <dc:date>2018-10-22T18:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: JS tabbed content - On load issues</title>
      <link>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212925#M9133</link>
      <description>&lt;P&gt;Hi Tim&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I'd caused some confusion by accidentally making a change and&amp;nbsp;altering the structure, which I quickly reverted when I noticed. It seems you had already picked up the post while it was changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for explaining your reasoning behind it, the child element makes sense now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help. +1 Kudos for you.&amp;nbsp;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://community.hubspot.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 08:52:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/JS-tabbed-content-On-load-issues/m-p/212925#M9133</guid>
      <dc:creator>Stevie-Kv</dc:creator>
      <dc:date>2018-10-23T08:52:58Z</dc:date>
    </item>
  </channel>
</rss>

