Jump to content

Archived

This topic is now archived and is closed to further replies.

chamois_blanc

DMS adding 'in collapse' classes and height to div

Recommended Posts

chamois_blanc

Hello,

 

I'm trying to access my page with an anchor, ie page/#anchor and the DMS javascript code seems to be adding "in collapse" classes and a height of 105px to the div whose id is the anchor. This seems related to animations. How can I disable this behavior? See page source extract below.

 

Gilles

 

<!-- Canvas Area | Section Template -->
<section id="pl_areaum2rr3u" data-object="PLSectionArea" data-sid="pl_area" data-clone="um2rr3u"  class="pl-area pl-area-sortable area-tag pl-dark-img   pl-bg-cover section-pl_area" style="  "><div class="pl-area-pad fix"> <div class="pl-area-wrap " style="padding-top: 20px; padding-bottom: 20px;">

<div class="pl-content nested-section-area">
<div class="pl-inner area-region pl-sortable-area editor-row" style="">
<div class="row grid-row">

<!-- TextBox | Section Template -->
<section id="textboxuirfdt9" data-object="PageLinesTextBox" data-sid="textbox" data-clone="uirfdt9"  class="pl-section span12 offset0 section-title    pl-bg-cover section-textbox" style="  "><div class="pl-section-pad fix"><div class="textbox-wrap pl-animation  no-anim" style=""><div class="hentry" data-sync="textbox_content"><div id="anchor" class="navmenu-anchor in collapse" style="height: 105px"></div>

 

Share this post


Link to post
Share on other sites
Danny

Hi,

 

What HTML have you added to the textbox ?

Can you provide the code you have used and a link to the site in question please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
chamois_blanc

Hi Danny,

 

Here is a sample of one of the HTML textboxes that has the issue:

<div id="housing" class="navmenu-anchor"></div><a href="#housing" rel="m_PageScroll2id" class="betty-noir-font section-title-a">HOUSING</a>

Here is the webpage:

 

http://swinginatthesavoy.com/home/#housing

 

The webpage will load okay, but once you click on the "HOUSING" menu item, you will see the textbox moving down by 105px.

 

Gilles

Share this post


Link to post
Share on other sites
chamois_blanc

Mentioning that I had to add this less code due to the fixed header:

// fix anchor position when using http://swinginatthesavoy.com/#anchor due to the fixed header
// the padding is the height of the fixed header plus the height of the space between the beginning of the section and the corresponding anchor
// note that this is not really consistent from browser to browser
div.navmenu-anchor:target {
  height: 0px !important;
  @media screen and (min-width: 1024px) {
    padding-top:105px;
    margin-top:-105px;
  }
  @media screen and (min-width: 768px) and (max-width: 1023px) {
    padding-top:124px;
    margin-top:-124px;
  }
  @media screen and (max-width: 767px) {
    padding-top:46px;
    margin-top:-46px;
  }
}

I have three different headers based on window width, which explains the three conditions above. As you can see, I tried to force the height to 0px with css, but unfortunately and obviously, the javascript code that adds "in collapse" and sets the height takes precedence.

 

Gilles

Share this post


Link to post
Share on other sites
chamois_blanc

I found I can kind of workaround the problem by adding style="height:0px !important" to the div with the anchor. There is still a flicker when I click the link after the page is loaded. But at least the textbox does not move down anymore. I will leave the "housing" anchor as is so that you can take a look.

 

Gilles

Share this post


Link to post
Share on other sites
chamois_blanc

Okay adding that the workaround seems to be work in Safari and Chrome, but not in Firefox :(

Share this post


Link to post
Share on other sites
chamois_blanc

Just letting you know that I'm going to be fiddling with the less and javascript code. I want to see if I can get rid of the related less code entirely and handle the page load with #anchor event the same way I handle the scrolling to #anchor when clicking the navigation menu.

Share this post


Link to post
Share on other sites
chamois_blanc

After removing the less code, the "in collapse" classes and height attributes don't seem to appear anymore. So still a big mystery but not a problem anymore.

Share this post


Link to post
Share on other sites
Danny

DMS isn't as far as I can tell adding any of those collapse classes. As the code it has been added to is your code.

I am also not seeing these classes being included when you implement your code into a TextBox - https://cloudup.com/c2352Em6KE2


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
    • nizami
      By nizami+
      Using navbar section with correctly configured WP menu to display main navigation at https://elenaangel.com. 
      All fine in desktop viewport. Menu displays twice in hamburger mode. How to fix this please? 

×