Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the css of an opened popup #1192

Open
carolinelilyyu opened this issue Jan 31, 2023 · 0 comments
Open

How to change the css of an opened popup #1192

carolinelilyyu opened this issue Jan 31, 2023 · 0 comments

Comments

@carolinelilyyu
Copy link

i want to change the brightness of an item. Tried following this but this format didn't help me change the css

$(".event").magnificPopup({

            callbacks: {
                open: function(){

                    $(".hidden-div").css("display", "block");
                },
                close: function(){

                    $(".hidden-div").css("display", "none");
                }
            },

            items: {

                src: ".hidden-div",
                type: "inline"
            },
            closeBtnInside: true
        });

Here is my code:

$('.project-area .grid .test-popup-link').magnificPopup({
    type: 'image',
    tLoading: 'Loading image #%curr%...',
    gallery: { enabled: true },
    image: {
        tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
    },
    callbacks: {
        open : function(){
            // var mp = $.magnificPopup.instance,
            //     t = $(mp.currItem.el[0]);
            // console.log( t.attr );
            $("test-popup-link").css("filter", "brightness(0.5)");
            console.log($("test-popup-link").src)
        }
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant