Make logo, social media and search position "sticky"

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sun Nov 23, 2014 11:34 am
Reply with quote
Report this post
Hi,

Look here, test.madonna.nl.
When you scroll down only the menu stays on top and visible.
The logo, social media and search position "disappear".

I want those positions to be in view, just like the menu, when you scroll down.

is that possible?

Kind regards, GertJan
User avatar
Gold Boarder

GK User
Sun Nov 23, 2014 2:13 pm
Reply with quote
Report this post
Hi,
start from this
Code: Select all
#gkTop {
    background:  white;
    height: 80px;
    position: fixed;
    width: 100%;
    z-index: 999;
}
#gkPageContentWrap {
    margin-top: 80px;
}


User avatar
Platinum Boarder

GK User
Sun Nov 23, 2014 6:30 pm
Reply with quote
Report this post
Thanks, it works. I changed 80px to 100px.. and now it looks good!
User avatar
Gold Boarder

GK User
Sun Nov 23, 2014 7:37 pm
Reply with quote
Report this post
Yes, sure. I used 80px because I wanted to reduce height of this element as much a possible ;)

About mobile view, probably you have to override it when screen size would be smaller than....
User avatar
Platinum Boarder

GK User
Sun Nov 23, 2014 8:31 pm
Reply with quote
Report this post
Oscar E wrote:Yes, sure. I used 80px because I wanted to reduce height of this element as much a possible ;)

About mobile view, probably you have to override it when screen size would be smaller than....


Yes on mobile I want it to scroll and not be sticky at the top... but don't know how to do that. Can you help me?
User avatar
Gold Boarder

GK User
Sun Nov 23, 2014 8:54 pm
Reply with quote
Report this post
No problem. For example mix new with old code:

Code: Select all
@media only screen  and (min-width : 1224px) {
HERE
}


More info: http://css-tricks.com/snippets/css/medi ... d-devices/
User avatar
Platinum Boarder

GK User
Mon Nov 24, 2014 11:48 am
Reply with quote
Report this post
Oscar E wrote:No problem. For example mix new with old code:

Code: Select all
@media only screen  and (min-width : 1224px) {
HERE
}


More info: http://css-tricks.com/snippets/css/medi ... d-devices/


Is this the mixed up code you are talking about:

Code: Select all
@media only screen and (min-width : 1224px) {
#gkTop {
        background:  white;
        height: 100px;
        position: fixed;
        width: 100%;
        z-index: 999;
    }
    #gkPageContentWrap {
        margin-top: 100px;
    }
}
User avatar
Gold Boarder

GK User
Mon Nov 24, 2014 12:56 pm
Reply with quote
Report this post
So you're now great DJ. :mrgreen:

Of course you can change value from 1224 to 1024 - if on tablets it can be shown also. Just test.
User avatar
Platinum Boarder

GK User
Mon Nov 24, 2014 3:36 pm
Reply with quote
Report this post
Mmm... it is not working OK.
It is OK on the cumputer... the logo etc stays sticky.
But it also stays sticky on my iphone... :(
User avatar
Gold Boarder

GK User
Tue Nov 25, 2014 12:31 pm
Reply with quote
Report this post
maybe try to use: min-device-width

and under last "}" add this one:

Code: Select all
/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {

#gkTop {position: relative;z-index: 0;}

}


Apple devices always works different.
User avatar
Platinum Boarder

GK User
Tue Nov 25, 2014 8:32 pm
Reply with quote
Report this post
This is the code I included.. but it doesn't work..

Code: Select all
@media only screen and (min-device-width: 1224px) {
#gkTop {
        background:  white;
        height: 100px;
        position: fixed;
        width: 100%;
        z-index: 999;
    }
    #gkPageContentWrap {
        margin-top: 100px;
    }
}

/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {

#gkTop {position: relative;z-index: 0;}

}


Something wrong in the code?
User avatar
Gold Boarder

GK User
Wed Nov 26, 2014 2:36 pm
Reply with quote
Report this post
sorry, I gave up. No idea except maybe this : http://extensions.joomla.org/extensions ... ting/11173
User avatar
Platinum Boarder


cron