Jump to content
  • 0

Выпадающее меню одной строкой


ksonline
 Share

Question

Привет!

Сделал выпадающую гориз. менюшку в Dreamweaver, когда увеличиваешь страницу часть элементов меню прескакивает на новую строку, пробовал различные варианты форматировая, пробовал поместить меню в таблицу ничего не получается (позникают проблемы с JS ) , подскажите что можно сделать в данной ситуации, нужно чтобы меню при изменении масштаба не ломалось...может рецептик какой кто знает?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Документ без названия</title>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>
<body onload="MM_preloadImages('images/bt_h_on_main.gif','images/bt_h_on_arhierey.gif','images/bt_h_on_eparhiya.gif')">

<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','images/bt_h_on_main.gif',1)"><img src="images/bt_h_main.gif" name="Image1" width="111" height="48" border="0" id="Image1" /></a><a class="MenuBarItemSubmenu" href="#"></a>
</li>
<li><a href="#"></a><a href="arhierey.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','images/bt_h_on_arhierey.gif',1)"><img src="images/bt_h_arhierey.gif" alt=" " name="Image2" width="110" height="48" border="0" id="Image2" /></a></li>
<li><a class="MenuBarItemSubmenu" href="#"></a><a href="eparhia.html " onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','images/bt_h_on_eparhiya.gif',1)"><img src="images/bt_h_eparhiya.gif" alt="" name="Image3" width="94" height="48" border="0" id="Image3" /></a>
<ul>
<li><a class="MenuBarItemSubmenu" href="#">Элемент 3.1</a>

</li>
<li><a href="#">Элемент 3.2</a></li>
<li><a href="#">Элемент 3.3</a></li>
</ul>
</li>

</ul>
<p>  </p>
<p> </p>
<p> </p>

</div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>


и css файл


@charset "UTF-8";


ul.MenuBarHorizontal
{
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
cursor: default;
width: auto;



}

ul.MenuBarActive
{
z-index: 1000;
}

ul.MenuBarHorizontal li
{
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
position: relative;
text-align: left;
cursor: pointer;
font-family: Verdana, sans-serif;
float: left;
}

ul.MenuBarHorizontal ul
{
margin: 0;
padding: 0;
list-style-type: none;
font-size: 100%;
z-index: 1020;
cursor: default;
width: 9em;
position: absolute;
left: -1000em;
top:48px;

}

ul.MenuBarHorizontal ul.MenuBarSubmenuVisible
{
left: auto;
}

ul.MenuBarHorizontal ul li
{
width: 8.7em;

}

ul.MenuBarHorizontal ul ul
{
position: absolute;
margin: -5% 0 0 95%;
}

ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible
{
left: auto;
top: 0;

}


ul.MenuBarHorizontal ul li a
{
padding:5%;
}

ul.MenuBarHorizontal
{
display: inline;
}




ul.MenuBarHorizontal a
{
display: block;
cursor: pointer;
background-color: #8bbbf1;
padding: 0;
color:#FFF;
text-decoration: none;
}

ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus
{
background-color: #6799ca;
color: #FFF;
}

ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible
{
background-color: #6799ca ;
color: #FFF;
}


ul.MenuBarHorizontal iframe
{
position: absolute;
z-index: 1010;
filter:alpha(opacity:0.1);
}




@media screen, projection
{
ul.MenuBarHorizontal li.MenuBarItemIE
{
display: inline;
float: left;
background: #FFF;
}
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   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.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy