leafo / sticky-kit

A jQuery plugin for creating smart sticky elements
http://leafo.net/sticky-kit
2.91k stars 517 forks source link

StickyKit and Iframes (I know!) #164

Open neotropic2023 opened 8 years ago

neotropic2023 commented 8 years ago

I have to use an iframe on this one page due to how our client styles their newsletter, the formatting would get all wonky posted right on the page. So i place it in an iframe to maintain it's layout.

Any ways. On the page I also have a small sidebar that stickies. In this instance, when an iframe is on the page:

  1. Each scroll reloads the iframe URL.
  2. Sidebar does not sticky (after putting a timeout delay on the initialization, it does sticky now. Makes sense, I resize the iframe first on load to get the inner page height, so maybe it was not getting the right height)
  3. Whole page becomes jittery.

I personally do not want to use an iframe, but I have to. All else fails, I will just not have the sidebar on this page.

neotropic2023 commented 8 years ago

Decided to not use a sidebar on page with iframe. No biggy! :)

adods commented 8 years ago

The same problem will appear when there's ads in the sidebar. The ads get reloaded everytime the js wrap the original DIV to make it sticky or remove the wrapper.

I think, if the DIV keep wrapped from the start and only get unwrapped when detached will solve the problem, but I'm not a JS Programmer, if the dev could update this, it will be great

pratham2003 commented 8 years ago

Yes, I see that the div on which sticky_inside_parent() is called is constantly wrapped and unwrapped by a container when scrolling back top, this causes the iframes to reload.

This needs to be fixed soon..

aaaa0441 commented 8 years ago

+1 for this issue. Can any one explain why this is happening?

I got error Error: Blocked a frame with origin "http://192.168.15.107:9000" from accessing a cross-origin frame. in Chrome console when scroll happens.

aaaa0441 commented 8 years ago

My problem was more likely related to issue https://github.com/leafo/sticky-kit/issues/45. By providing 'spacer' and 'parent' options, the issue is circumvented.