Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Disabling sticky based on screen height


Dear,

In the demo : https://preview.keenthemes.com/metronic8/demo26/apps/subscriptions/add.html
Sticky summary is disabled if my screen height is lower than summary block.

How does it work ? I can't reproduce it !

Thanks for reply !


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (6)


Hi,

Yes, this is how the KTSticky works, if there is no available space on the screen the sticky mode is not activated.

if you need any further clarifications please do let us know.

Regards.



But doesn't work for me, and I don't know why.

My code :


<div class="row g-5 g-xl-10 mb-5 mb-xl-10 justify-content-md-center">
<div class="col-lg-3 col-md-12">
<div data-name="workplace_info_sticky_width"></div>
<div class="card card-flush" data-kt-sticky="false"
data-kt-sticky-name="workplace_info_sticky"
data-kt-sticky-offset="{default: false, lg: "150px"}"
data-kt-sticky-width="{target: "#workplace_info_sticky_width"}"
data-kt-sticky-left="auto"
data-kt-sticky-top="calc(100px + 2.5rem)"
data-kt-sticky-animation="true"
data-kt-sticky-zindex="95"
data-kt-sticky-reverse="true"
>
<div class="card-header align-items-center py-5 gap-2 gap-md-5">
My header
</div>
<div class="card-body pt-15 px-0">
My long card

</div>
</div>
</div>
<div class="col-lg-9 col-md-12">
<div class="card card-flush">
<div class="card-header align-items-center py-5 gap-2 gap-md-5">
My header
</div>
<div class="card-body">
My body
</div>
</div>
</div>
</div>
</div>

I replace id= by data-name because editor remove id attr

I can make a video to show you in private what I have

Thank you for support



I missed data-kt-sticky="false" in my example, I have data-kt-sticky="true" in my code



Hi,

Does it work with data-kt-sticky="true" ?
If you still need help could you please let us know your Metronic version?

Do you have any JS error in your page that may cause the core components' initialization somehow?

Regards.



Hi,
I use flex instead of col and it's work.

Thanks



Hi,

Great! All the best with your project. If you need any further help please do let us know.

Regards.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(