Code Monkey home page Code Monkey logo

Comments (18)

KingSora avatar KingSora commented on May 19, 2024

At first sight it appears you are trying to initialize the plugin into a iframe of facebook. This won't work due to a cross-origin exception (the same thing which is happening now). But this isn't a plugin error, this happens because facebook doesn't want you to modify their content.

Please upload a small codesample of the facebook SDK on https://jsfiddle.net/, so I can get a deeper understanding of the problem. Maybe there is some workaround or I am misunderstanding it right now.

from overlayscrollbars.

fredleput avatar fredleput commented on May 19, 2024

Thx, here's my code (i don't use any iframe but the facebook SDK create one...) :

https://jsfiddle.net/fredleput/cpzjq61u/

I get the error even if i use https. If i don't instanciate scrollbar error disappear.

from overlayscrollbars.

KingSora avatar KingSora commented on May 19, 2024

https://jsfiddle.net/cpzjq61u/3/

This script creates a div with the id #fb-root but I don't see any facebook content or anything?... To fix your problem, I have to see how the content which is loaded by the SDK really looks like. Please offer a version where the SDK is fully loaded and the content actually appears. Ignore the initialization of my plugin completely.

from overlayscrollbars.

fredleput avatar fredleput commented on May 19, 2024

you can see it in action here :
https://www.cc-paimpol-goelo.com/maquettes_cyber/gp3a-2/

from overlayscrollbars.

KingSora avatar KingSora commented on May 19, 2024

Well the scrollbar is loaded correctly on the element with the id #actualites-resumes-liste.
Am I overlooking something?

  • Tested with Firefox, Chrome, Edge and IE

from overlayscrollbars.

fredleput avatar fredleput commented on May 19, 2024

With the same content here's a screenshot of chrome's console with error message :
screenshot

from overlayscrollbars.

KingSora avatar KingSora commented on May 19, 2024

I am unable to reproduce this error... Screenshot
Maybe this article can help you?

I am sorry, but it seems like this error occurs because of your browser. Try to load jQuery not from a CDN but localy from your server. Theres a possibility this error occurs because of the async loading of the facebook SDK, but you have to test this somehow... I honestly have no clue and can only guess whats the error.

from overlayscrollbars.

fredleput avatar fredleput commented on May 19, 2024

Thx i'll test that soon.

from overlayscrollbars.

KingSora avatar KingSora commented on May 19, 2024

Well I've got other ideas:
Try to load the Facebook SDK after the plugin was initialized, or try to load it in a capsulated div and not direct into the body.

from overlayscrollbars.

fredleput avatar fredleput commented on May 19, 2024

Hi,

My problem is solved but i don't know why. I load jquery from my server but i still add the same issue. It's only when i initialize the plugin via jquery instead of the default way that the problem disappeared.

from overlayscrollbars.

KingSora avatar KingSora commented on May 19, 2024

I'm glad your problem has been solved!
I've checked your code and I've noticed you are using v1.0.0 of the plugin. Please try to use the current version (v1.2.3) and report me if your website runs fine with it too.

Your can get v1.2.3 here.

Thanks!

from overlayscrollbars.

fredleput avatar fredleput commented on May 19, 2024

No problem with version 1.2.3 in my news module but i try to use it also in my customs overlays (fixed positioned div with content) and i don't succeed.

I initialize the plugin like this :

jQuery(overlayMainContent).overlayScrollbars({ overflowBehavior : { x: 'h', y: 'v-s' }, scrollbars: { visibility: 'v' }, callbacks : { onInitialized : function() { console.log('initialized'); console.dir(this); } } });
Initilization seems working (i have log in console) but scrollbars aren't created. I send you a screenshot. You can see it in action here :
http://www.cc-paimpol-goelo.com/maquettes_cyber/gp3a-2/

just choose a news and click on 'En savoir plus'

screenshot-1 : we can see that classes are added to the container
screenshot-2 : log i call in the onInitialized callback

Thx very much for your help, ireally appreciate !

screenshot-1
screenshot-2

from overlayscrollbars.

KingSora avatar KingSora commented on May 19, 2024

Well, the mistake is, that you are loading different content into your div. This content is overwriting the DOM structure of the plugin.
To fix this you have two possibilites:

  1. Use a wrapper and initialize the plugin to the wrapper. Here is a demo: https://jsfiddle.net/Lesway8u/6/
    The key is to let the wrapper div #wrapper untouched (only initialize the plugin to this div) and load everything into #content.
  2. You have to initialize the plugin each time your window gets opened and destroy it each time it gets closed.

I recommend the first solution since its more performent and more "elegant".

from overlayscrollbars.

fredleput avatar fredleput commented on May 19, 2024

Of course, i didn't thought to that ! It works great now. Many thx, you're the best !

from overlayscrollbars.

KingSora avatar KingSora commented on May 19, 2024

I'm glad I could help you!
I'll close this issue now, if you have any other questions don't hesitate to ask them.

from overlayscrollbars.

danialdezfouli avatar danialdezfouli commented on May 19, 2024

i have the same issue with google ads and overlayscrollars

from overlayscrollbars.

KingSora avatar KingSora commented on May 19, 2024

@eagle-design Please open a new issue with your problem. Don't forget to provide or create a small example on https://jsfiddle.net so I can better understand your issue.

from overlayscrollbars.

danialdezfouli avatar danialdezfouli commented on May 19, 2024

i had fixed it by enabling cords

from overlayscrollbars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.