Closed ghost closed 13 years ago
It needs some investigation, I write you soon.
Do you have an example to see?
I'd played with iframes. I have create two demo pages, so you can find usefull advices. http://www.areaaperta.com/nicescroll/test/iframe.html http://www.areaaperta.com/nicescroll/test/iframe2.html
You find a donwload to new beta version, with a more robust iframe support.
Let me know if you find the solution.
Hi, I will test this and get back to you! Thanks for your help.
In your second demo, the one with the wrapper, it scrolls to top, but as you can also see in your demo, off-site links will show the regular scrollbar and it doesn't calculate the height right, so there's extra whitespace at the bottom of the page. Also, a scrollbar is visible, even though the page doesn't need scrolling.
Thanks again!
The demo pages use actual version. Have you test the beta version? (you find link in the first iframe page)
I have tested, but it didn't make a difference.
Do you have an example page to view the problem? So I can help you.
I have the exact same issues as on this page: http://www.areaaperta.com/nicescroll/test/iframe2.html Sorry, don't have an example I can actually show at the moment. But the issues are exactly the same.
Off-site links like http://fsf.org/ will show the regular scrollbar and it doesn't calculate the height right, so there's extra whitespace at the bottom of the page.
I have tested this in Firefox 7 and Chrome.
That's the problem! Off-site sites can't work. Cross-domain policy of major browser don't permits nicescroll script to hide scrollbar and gain the height of iframe content. There is same tricks to achieve this info but is necessary to modify the off-site page html too. (look this http://www.cakemail.com/the-iframe-cross-domain-policy-problem/)
With same-domain page, script can resize iframe automatically.
If you can obtain height of content (as in the example link), you can resize height of iframe then recall $("nameofdiv").getNiceScroll().onResize(); (in the iframe2 page you can find more complete code, but iframe2 works only for same-domain pages)
It seems to be working for now. Much appreciated.
One more question: is it possible to hide the scrollbar when no scrolling is needed? i.e. the page is not long enough?
yes, you'll do in the next version. (see preview of features on the wiki)
Hi,
I'm really loving your plugin, but I have a question. The scrollbar works perfectly in iframes, but when you click a link on the page, the scrollbar preserves its location even on the new page. I need it to scroll to the top, but I can't figure out how to do it.
Any help would be greatly appreciated.
Yvonne