Jump to content
Sign in to follow this  
rsn

Плавающая шапка с меню

Recommended Posts

здравствуйте

Интересует модуль плавающее меню с шапкой с возможностью произвольного настраиванием как на этом сайте(http://www.com/albornoz-lisos-450.html)

кто встречал подскажите

вот фото

Share this post


Link to post
Share on other sites

обязательно нужен модуль?

а вот тут делал без модуля http://matrasklass.ru/

Share this post


Link to post
Share on other sites

Зафиксируйте Шапку это css или что вы имели ввиду?

Share this post


Link to post
Share on other sites

часть кода шапки со скриптом

<div id="header">


<div id="menubac" style="top: 0px;">
<div id="menubox">
<div class="links">

      <?php foreach ($informations as $information) { ?>
      <a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a>
      <?php } ?>	  
	  <a href="./index.php?route=information/contact">Контакты</a>	  
     </div>
</div>
</div>

  <?php if ($logo) { ?>
  <div id="logo"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
  <?php } ?>


<script>
  var h_hght = 135; // высота шапки
  var h_mrg = 40;     // отступ когда шапка уже не видна
  $(function(){
   $(window).scroll(function(){
      var top = $(this).scrollTop();
      var elem = $('#menu');
      if (top+h_mrg < h_hght) {
       elem.css('top', (h_hght-top));
      } else {
       elem.css('top', h_mrg);
      }
    });
  });
</script>

<?php if ($categories) { ?>
<div id="menu">
  <ul>
  <div class="home"><a  title="<?php echo $text_home; ?>" href="<?php echo $home; ?>"></a></div>
    <?php foreach ($categories as $category) { ?>
    <li><?php if ($category['active']) { ?>
<a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php } ?></li>
    <?php } ?>
<li class="spec"><a href="./index.php?route=product/special">Акции</a></li>
<li class="spec"><a href="./index.php?route=product/testimonial">Отзывы</a></li>
  </ul>
</div>
<?php } ?>
<div id="notification"></div>
 

остальное стилями - стили можно посмотреть на сайте который я указал, с помощью фаербага

 

/* links */
 
 
#header .links {
position: relative;
left: 0px;
top:0px;
height: 40px;
background: url(../image/navSep.jpg) repeat-x #01BBD0;
bottom: 3px;
font-size: 12px;
text-align: center
}
#header .links a {
color: #FFF;
padding: 10px 10px 10px 10px;
position: relative;
top: 12px;
text-transform: uppercase;
}
#header .links a + a {
margin-left: 8px;
border-left: 1px solid #CCC;
}





/* menubac */ 

#menubac { 
position: fixed;     
height: 40px;     
float: left;     
left: 0;     
text-align: left;     
width: 100%;     
z-index: 999; 
} 
#menubox {     
width: 100%; 
max-width: 1100px; 
min-width: 970px;     
margin-left: auto;     
margin-right: auto;     
position: relative; 
} 

/* menu */

#menu {
	background: url(../image/menubgright.png);
	border: 1px solid #ddd;
	height: 34px;
	width:1000px;
	;	
	margin-bottom: 15px;
	-webkit-border-radius: 5px 5px 5px 5px;
	-moz-border-radius: 5px 5px 5px 5px;
	-khtml-border-radius: 5px 5px 5px 5px;
	border-radius: 5px 5px 5px 5px;	
	top: 130px; 
   position: fixed;
   z-index: 15;
}
#menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
#menu .home
{
	float: left;
	width:5%;
	margin-left: 6px;	
	list-style: none;	
	border-right: 1px solid #bfbebe;
	height: 33px;
	-webkit-transition: all 0.3s ease-in 0s;
	-moz-transition: all 0.3s ease-in 0s;
	transition: all 0.3s ease-in 0s;
	
}
#menu .home a
{
	float: left;
	height: 33px;
	width: 100%;
	margin-left: 0px;	
	background: url(../image/home.png) left 30% top 10% no-repeat;
}
#menu .home a:hover
{
	background: url(../image/home1.png) left 30% top 55% no-repeat;
}
#menu > ul > li {
	border: 1px solid #ddd;	
	width: 150px;
	-webkit-border-radius: 5px 5px 5px 5px;
	-moz-border-radius: 5px 5px 5px 5px;
	-khtml-border-radius: 5px 5px 5px 5px;
	border-radius: 5px 5px 5px 5px;	
	position: relative;
	text-align: center;
	float: left;
	z-index: 20;	
	padding: 2px 0px 0px 0px;
}
#menu > ul > li:hover {
}
#menu > ul > li > a.active {	
}
#menu > ul > li > a {
	text-transform: uppercase;
	color: #333;
	white-space: nowrap;	
	text-decoration: none;
	display: block;
	padding: 6px 10px 3px 10px;
	margin-bottom: 5px;
	z-index: 6;
	position: relative;
}
#menu > ul > li:hover > a {
	color: #028695;
	font-weight: bold;
}
#menu > ul > li > div {
	display: none;
	background: #FFFFFF;
	position: absolute;
	z-index: 5;
	padding: 5px;
	border: 1px solid #000000;
	-webkit-border-radius: 0px 0px 5px 5px;
	-moz-border-radius: 0px 0px 5px 5px;
	-khtml-border-radius: 0px 0px 5px 5px;
	border-radius: 0px 0px 5px 5px;
	background: url('../image/menu.png');
}
#menu > ul > li:hover > div {
	display: table;
}
#menu > ul > li > div > ul {
	display: table-cell;
}
#menu > ul > li ul + ul {
	padding-left: 20px;
}
#menu > ul > li ul > li > a {
	text-decoration: none;
	padding: 4px;
	color: #FFFFFF;
	display: block;
	white-space: nowrap;
	min-width: 120px;
}
#menu > ul > li ul > li > a:hover {
	background: #000000;
}
#menu > ul > li > div > ul > li > a {
	color: #FFFFFF;
}


 

Share this post


Link to post
Share on other sites

ой! простите, :oops:  я не знал...больше не буду.... :-)

у меня там 2 панели которые выполняют разную функцию...но думаю это естественно не важно, раз уж тут такое вон...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.