How to make the mobile header transparent in landing-4.html template

23 replies · opened Oct 2, 2016

PpooloffireOct 2, 2016

Hello,

When I view the landing-4.html template full size, the header is transparent, but the built in behavior is: when I shrink the window far enough horizontally and it switches to mobile mode, the header turns dark and the top of my background image gets covered up.

My first question is, how can I make the mobile header retain its transparency like the web version so the background image isn't covered up?

My second question is, for the landing-4.html template, is there a way to provide a different background image to load only for mobile, and if so where would I set that up?

Thanks in advance,

John

SSemicolon WebSTAFFOct 3, 2016

Hello,

  1. Making the Header Transparent on Mobile Devices is Definitely Possible. You can consider using the following CSS Code:
@media (max-width: 991px) {
	#header.dark.transparent-header { background-color: transparent; }

	#header.transparent-header + #slider {
		top: -100px;
		margin-bottom: -100px;
	}
}

However, this will only make the Header Transparent and but not make it work accordingly when you Open the Menus after clicking the Trigger.

  1. This is Definitely Possible too! Consider using the Responsive Classes. You can add a Custom Class example .custom-slider-bg to the #slider Container and then control the Background using the CSS:
.device-lg .custom-slider-bg { background-image: url('images/your-image-lg.jpg'); }

.device-md .custom-slider-bg { background-image: url('images/your-image-md.jpg'); }

.device-sm .custom-slider-bg { background-image: url('images/your-image-sm.jpg'); }

.device-xs .custom-slider-bg { background-image: url('images/your-image-xs.jpg'); }

.device-xxs .custom-slider-bg { background-image: url('images/your-image-xxs.jpg'); }

This will definitely work fine. Let us know if we can help you with anything else or if you find any issues.

PpooloffireOct 3, 2016

Hello, thank you for the quick reply.

I think I lack the experience and context to know where the code you've provided needs to be situated.
I've tried inserting it into the style.css, the responsive.css, and the responsive-rtl.css files alternately, but am having no success.

Is there a way that you could show me specifically which files to insert the code into and where exactly within the files?

Thank you for your patience,
John

PpooloffireOct 4, 2016

Sorry, I forgot to mark as unresolved so I'm not sure if you saw my last message..

PpooloffireOct 4, 2016

I guess I can't change the resolved status, but please see my question above.
Thanks,
John

SSemicolon WebSTAFFOct 5, 2016

Hello,

Please make sure that you add your Custom CSS Codes in the css/custom.css File and link this CSS File in your header as described in the Documentation > Start > Customization Section.

Hope this Helps! This will definitely work fine.

Let us know if we can help you with anything else or if you find any further issues.

PpooloffireOct 5, 2016

Hi, thanks for the reply.

By following your instructions I was able to get the mobile transparent header working!

But the second section of code you provided:

.device-lg .custom-slider-bg { background-image: url('images/your-image-lg.jpg'); }

.device-md .custom-slider-bg { background-image: url('images/your-image-md.jpg'); }

.device-sm .custom-slider-bg { background-image: url('images/your-image-sm.jpg'); }

.device-xs .custom-slider-bg { background-image: url('images/your-image-xs.jpg'); }

.device-xxs .custom-slider-bg { background-image: url('images/your-image-xxs.jpg'); }

didn't show any of my new backgrounds when I changed the size of the the window or viewed them in a mobile device.

I put that code block into the same css/custom.css file as I put the transparent header code, and made sure my new background jpgs existed...

What could have gone wrong?

Thanks,
John

SSemicolon WebSTAFFOct 6, 2016

Hello,

We Really apologize for the Inconveniences caused. Can you please provide us with a Live URL with the CSS Codes added so that we can check out the exact issue and provide you with a more accurate solution for this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

PpooloffireOct 7, 2016

Hello, and thanks for your reply.

a live url is:
phonewife.com/index91.html

We like the way it looks when its web sized, and we're trying to get the mobile size to look like the web version (i.e. transparent top, and a picture scaled appropriately) with a functional menu.

The above url reflects the code you provided me which turns the header transparent, but the side effects seem to be that with transparency enabled, the page text is now pushed up too far to the top, and the menu falls apart visually when its pressed. My business partners are set on the header being transparent, but it doesn't seem functional this way and I'm not sure what to do- the transparent header is the direction they want to go.

Regarding the background images, the custom size images I have in there now are just pinker versions of the splash image- just to give me a quick idea if its working. As I change the window width, the image color doesn't seem to change, so it doesn't look like the new images are loading.

Anything you can do to help us with these things so the mobile site can look like the website would be very much appreciated.

Thanks for your help and patience,
John

Attached are the three style sheets I'm using,
style.css,
responsive.css,
custom.css

PpooloffireOct 13, 2016

Hello,
any word on this yet?
My business partners keep asking me about it.

Thanks in advance,
John

SSemicolon WebSTAFFOct 15, 2016

Hello,

We Really Apologize about the Delay! Here are the Solutions for your Issues:

  1. Consider adding the following CSS Code to fix the issue with the Slider Content moving up:
.device-xs #slider,
.device-xxs #slider { padding-top: 100px; }
  1. Add the following CSS Code to fix the Issue with Transparent Header on Mobile Devices when opening the Menu:
@media (max-width: 991px) {
	#header { min-height: 100px; }

	#header-wrap {
		position: absolute;
		width: 100%;
		min-height: 100px !important;
	}

	body.primary-menu-open #header-wrap { background-color: rgba(0,0,0,0.85); }

	body.primary-menu-open .dark #primary-menu:not(.not-dark) ul li { border-top-color: rgba(255,255,255,0.2) !important; }
}

This is the Best Possible Solution currently available.

  1. The Background Images CSS Codes that you have added in the css/custom.css File is perfectly fine but they are not changing on Different Devices because the .custom-slider-bg Class has not been added to the #slider Tag. As soon as you add this Class this issue will be automatically resolved.

This should definitely work fine. Let us know if we can help you with anything else or if you find any further issues.

PpooloffireOct 17, 2016

Hi,
Thank you, that's much better on the menu!

The only problem I have is if I click "contact" for example, it takes me to the contact section, but if I scroll back up, the header is dark again, and the menu is messed up . Is there anything I can do?

Regarding adding the .custom-slider-bg class to the slider tag, I'm having trouble getting it to work...

Do you mean modify the line below?

<section id="slider" class="slider-parallax dark full-screen" style="background: url(images/landing/landing1a1.jpg) center;">

On that line I tried :

<section id="slider" class="custom-slider-bg" style="background: url(images/landing/landing1a1.jpg) center;">

and

<section id="slider" class="custom-slider-bg dark full-screen" style="background: url(images/landing/landing1a1.jpg) center;">

and

<section id="slider" class="slider-parallax dark full-screen custom-slider-bg" style="background: url(images/landing/landing1a1.jpg) center;">

but some messed up the page, and none of them would work..

Can you give me the exact line of code that will make it work?

Thank you so much for your patience and all of your help...

(included is my latest custom.css file)

John

SSemicolon WebSTAFFOct 19, 2016

Hello,

  1. We Apologize about this Issue. There appears to be a Minor Bug in the One Page Scrolling Function while handling the Primary Menu Expand/Collapse States. Please find the following code in the js/functions.js File inside the onePageScroll: function() Function Block:
if( windowWidth  0 ) {
		$('#primary-menu > ul.mobile-primary-menu, #primary-menu > div > ul.mobile-primary-menu').toggleClass('show', false);
	} else {
		$('#primary-menu > ul, #primary-menu > div > ul').toggleClass('show', false);
	}
	$pagemenu.toggleClass('pagemenu-active', false );
}

and replace it with:

if( windowWidth  0 ) {
		$('#primary-menu > ul.mobile-primary-menu, #primary-menu > div > ul.mobile-primary-menu').toggleClass('show', false);
	} else {
		$('#primary-menu > ul, #primary-menu > div > ul').toggleClass('show', false);
	}
	$pagemenu.toggleClass('pagemenu-active', false );
	$body.toggleClass("primary-menu-open", false);
}

This will definitely fix this issue.

  1. Regarding the Background Image, please find the following code:

and replace it with:

This should definitely fix your issue. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

PpooloffireOct 20, 2016

Hello and thank you so much for your help.
Everything is working great thanks to the code that you sent.

Is there a way to get the background image to scale down even more as the window size shrinks? On the current page (index91.html) the image of the woman is too big on a phone, because we can't see enough of her.

I can see how the background image scales proportionally to the window until the window shrinks to a certain size, then stops as the window continues shrinking, and then steps down at some other points along the way, but the end result is that the image is still too big when it reaches mobile size. How can we get it to scale down more?

Thank you again for your continued support and patience,
John

SSemicolon WebSTAFFOct 24, 2016

Hello,

Since you are using the Same Image for all the Resolutions, it would not be possible to shrink the Image Dimensions on Mobile Devices since the Slider area adjusts according to the Content inside it and the Image then adjusts accordingly. This is why you will need to use different Images for different devices to optimize the Overall Look.

Hope this Helps!

Thanks for your Patience. Do let us know if we can help you with anything else or if you find any further issues with Canvas.

PpooloffireOct 24, 2016

Thanks for your reply!

OK, so all we need to do is make the image switching work... I added the code you sent, but it never seemed to work switching the background images.
Included is the custom.css file which has different images. They are slightly different colors..

If you can help with this last thing, I think we will finally be done.

Thanks again for all your help.

John

SSemicolon WebSTAFFOct 25, 2016

Hello,

To fix this issue, you will need to remove the Inline Styling Background Image from the #slider Element. So your Code will look like this:

This will definitely work fine. Let us know if we can help you with anything else or if you find any further issues.

PpooloffireOct 25, 2016

Hello,
Thanks for the reply.
I replaced what was there with your code, but now no background image shows at all.
Can you take a quick look?
Thanks,
John

SSemicolon WebSTAFFOct 25, 2016

Hello,

We have just checked this out for you and the issue is that since the css/custom.css File is inside the css/ Folder. You will need to add a Proper File Location for the Images. So the background-image: url('images/landing/landing1a1.jpg'); will be background-image: url('../images/landing/landing1a1.jpg'); since the images/ Folder is outside the css/ Folder and in the Main Directory.

This should definitely fix your issue. Let us know if we can help you with anything else or if you find any further issues.

PpooloffireOct 26, 2016

Hi,
Thank you for the reply.
I swapped the above code as you indicated but am still getting a blank image as the background.
Do you see what could be wrong?

Thanks,
John

SSemicolon WebSTAFFOct 26, 2016

Hello,

We Really apologize about the Inconveniences! Can you please provide us with a Live URL with the css/custom-3.css CSS Linking so that we can check out the exact issue and provide you with a more accurate solution for this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

PpooloffireOct 26, 2016

Hi,
The live URL that links to the custom.css file is: http://phonewife.com/index91.html
The file I previously uploaded was custom.css, not custom-3.css. I suspect the uploader is appending the extra numbers to avoid duplicates?
I'll try to upload custom.css again just to be sure.
Let me know if you need anything more.
Thanks,
John

PpooloffireOct 26, 2016

Yes, every time I upload custom.css it adds one to the number after the name- they should all be named custom.css.

Thanks,
John

SSemicolon WebSTAFFOct 26, 2016

Hello,

Thank You so much for your Continued Patience and Apologize about the Inconveniences! Please remove the following code from the #slider Element:

style="background: center center no-repeat; background-size: cover;"

and then simply add the following code in the css/custom.css File:

.custom-slider-bg {
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}

.device-lg .custom-slider-bg { background-image: url('../images/landing/landing1a1.jpg'); }

.device-md .custom-slider-bg { background-image: url('../images/landing/landing1a2.jpg'); }

.device-sm .custom-slider-bg { background-image: url('../images/landing/landing1a3.jpg'); }

.device-xs .custom-slider-bg { background-image: url('../images/landing/landing1a4.jpg'); }

.device-xxs .custom-slider-bg { background-image: url('../images/landing/landing1a5.jpg'); }

This should now definitely fix the issue. Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard