You are not logged in.

Announcement

Forum database was corrupt and an old backup was restored as temporary replacement. Registrations closed until the database is recovered. Please ask questions using the Contact form

#1 04-06-2013 17:13:39

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

subnav scrolling

Hi Thomas,

would it be possible to have the subnav fixed, too?

If i set $scrollHeader to false, the header stays, but the subnav doesn't.
It would be great, if i could have this only for the destop and tablet devices, but not for smartphone users, because the subnav would take too much space on smarts.

Offline

#2 04-06-2013 17:36:27

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: subnav scrolling

Add this code to css.php

<?php if(!$scrollHeader){?>
#subNavWrapper{
    position:fixed;
    right:0;
    left:0;
}
<?php
}
?>

I'll include it in the next versions as standard.

To change settings based on the device, you can use the php in your code of the config files:

if($device=="desktop"){
// Settings
}else if ($device == "tablet"){
// Settings
}else if ($device == "mobile"){
/ Settings
}

Offline

#3 04-06-2013 17:52:01

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: subnav scrolling

Thanks Thomas,

but that didn't work for me.
I have added

<?php if(!$scrollHeader){?>
#subNavWrapper{
    position:fixed;
    right:0;
    left:0;
}
<?php
}
?>

in inc/css.php at the bottom, BEFORE </style>

The page content now starts too high, the subnav is hidden by mainnav...

I'll let it that way for a few minutes. Maybe you can see for yourself.

Otherwise I'll wait for the update in next version.

- Pie

Offline

#4 04-06-2013 18:01:38

Thomas
Administrator
Registered: 10-03-2013
Posts: 897

Re: subnav scrolling

Oh, it seems I tested it on a local copy of an outdated version and there it worked perfectly. But in the newest version it works OK with:

<?php if(!$scrollHeader){?>
#subNavWrapper{
    position:fixed;
    right:0;
    left:0;
}
#centerWrapper{
    margin-top:40px;
}
<?php
}
?>

indeed right before the </style> tag.
maybe you need to change that margin-top argument to what you need.

Offline

#5 04-06-2013 18:04:46

Pie
Contributors
From: Germany
Registered: 17-03-2013
Posts: 366
Website

Re: subnav scrolling

You are the man! big_smile

Works perfektly!

Thanx again
- Pie

Offline

Board footer

Powered by FluxBB