-
AuthorPosts
-
calavaro Friend
calavaro
- Join date:
- August 2013
- Posts:
- 125
- Downloads:
- 7
- Uploads:
- 34
- Thanks:
- 28
- Thanked:
- 24 times in 1 posts
January 3, 2014 at 12:08 pm #193435Hi,
How can I change an image (in this case, the header image) based on screen resolution?
I need a different image for mobiles, another for tablets and yet one more for desktop. How can I achieve this?Thanks.
All the best,
Calavaro
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
January 3, 2014 at 1:10 pm #517283Hi Calavaro,
I suppose that you want to use different logo image in mobile/tablet/desktop (as in our demo site, there is only one image in header and it’s logo). You can use media jQuery to define specific CSS rule for specific screen resolution associated with above devices. http://code-tricks.com/css-media-queries-for-common-devices/
What you need is creating a new file named custom.css in /templates/ja_template_name/css folder and add this:
@media (max-width: 768px) {
.logo-image a {
background: url("../path/to/logo/here");
/*add your own custom CSS*/
}
}
Hope this helps
calavaro Friendcalavaro
- Join date:
- August 2013
- Posts:
- 125
- Downloads:
- 7
- Uploads:
- 34
- Thanks:
- 28
- Thanked:
- 24 times in 1 posts
January 4, 2014 at 3:26 am #517341Hi,
Thanks for the suggestion. However, my header is a new module position I have created.
I created 2 more new module positions for tablet header and mobile header, and I have been able to display them with the @media codes.However, for some reason I can not disable the displaying of the new modules using @media for resolutions over 1200px width.
Anything between 768px and 1199px the code to not display the module positions work. Anything over 1200px width, and the tablet and mobile modules display.
I have the following code in custom.css (I’m using the “red” template color)
@media (min-width: 768px) {
.ja-top-tab .ja-top-mobile .custom img {
display: none !important;
}How do I disable the module to display for 1200px or wider without disabling it for 767px or less width?
Thank you for your help.
All the best,
Calavaro
-
AuthorPosts
This topic contains 5 replies, has 2 voices, and was last updated by calavaro 10 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum