Code Monkey home page Code Monkey logo

Comments (2)

cbopp-art avatar cbopp-art commented on July 16, 2024

Hi @aquelfulano

I only have Firefox with OSX to test your issue and I couldn't experience any wrong behavior regarding the position of the video. However, you can try to make use of one of the hooks and call the resize function there.
https://cornel.bopp-art.com/lightcase/documentation/#hooks
https://cornel.bopp-art.com/lightcase/documentation/#resize

Example:

$('a[data-rel=lightcase]').lightcase({
	// Will be called right before the content will be displayed
	onBeforeShow : {
		callResize: function() {
			lightcase.resize();
		}
	},
	// Will be called after everything is loaded and visible
	onFinish : {
		callResize: function() {
			lightcase.resize();
		}
	}
});

from lightcase.

aquelfulano avatar aquelfulano commented on July 16, 2024

Thanks for the response.

I tried that, and at the first it didn't work for me.

But at last I tried to delay a little bit the function within a setTimeout method in the "onBeforeShow" hook, and finally worked.
This solution results in that the ".lightcase-contentInner" element was set the opacity as 0, so I had to set the opacity to 1 within the same setTimeout.

$('a[data-rel^="lightcase:video"]').lightcase({
            onBeforeShow : {
                callResize: function() {
                    setTimeout(function(){
                        lightcase.resize();
                        jQuery('.lightcase-contentInner').css('opacity', '1');
                    }, 100);
                }
            },

        });

For giving you more information about the issue. It only happened for me when reopening video lightcases. And working fine for the image lightcases.

And one more time, thanks for the response.

from lightcase.

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.