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

Adding a class selector to property of Image instance #34

Closed
antonioOrtiz opened this issue Mar 1, 2015 · 2 comments
Closed

Adding a class selector to property of Image instance #34

antonioOrtiz opened this issue Mar 1, 2015 · 2 comments

Comments

@antonioOrtiz
Copy link

Hi there, great plugin, btw! Question for you, Is the best way to add responsiveness to the galleries would be to add the addClass property which you listed in the documentation?

I have a gaggle of images and when one is clicked you'd go to your gallery and i'd like that container to be responsive http://antonio-p-ortiz.com/work/

I have tried:

new jBox('Image', {
width: 500,
height: 500,
imageFade:2000,
animation: 'slide',
addClass: '.jBox-image-container'
});

.jBox-image-container{ //
max-width: 100% !important;
height: auto!important;
display: block!important;
margin: 0px auto!important;
}

Or is there another way which is simpler which I have overlooked...?

Thanks so much!

@StephanWagner
Copy link
Owner

Hi Antonio, I just answered in the comment section on stephanwagner.me:

Thats one way to do it. But make sure to just add the class name(s) (widthout the dot):
addClass: 'jBox-image-container'

Also note that the classnames are added to the jBox wrapper. So you could do something like that:

addClass: 'jBoxResponsive'
.jBoxResponsive .jBox-container {
    max-width: 100% !important;
    /* More CSS... */
}

@StephanWagner
Copy link
Owner

You can use jBox v0.4.0 for responsive behavior

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

2 participants