Dreamweaverのあらかじめ設定されたjavascriptスニペットを使用して、ナビゲーションバー@http://www.skyboxlabs.comのいくつかのロールオーバーを作成しました。あらかじめ作成したDreamweaverのjavascriptコードがIEで作成する余分な空白を削除する方法
その面白い - Internet Explorerを除くすべてのブラウザでナビゲーションバーが素晴らしい(追加の空白はありません)ようです。
JavaScriptコードはIEに余分な空白を置きます。私はJavascriptを無効にしようとしましたが、問題は解消されていますので、あらかじめ設定されているDreamweaverコードと関係しています。
私は以下のサイトをさまざまなブラウザでチェックアウトしました。非常に役に立ちました。 IE9バージョンがjavascriptを含むTD要素の下に空白をレンダリングする方法を確認することができます。
http://netrenderer.com/index.php
明白な私はIE9で、余分な空白を削除する方法を上の任意のヒントに感謝 - これは、JavaScriptとどのように影響を与えるレイアウトのDreamweaverの問題を説明するのに役立つかもしれません。
私と一緒にここまで持っている誰:)以下
に事前に感謝2)外部JavaScriptファイルと3、HTML中1)ナビゲーションバーテーブル用のコードです)CSS
に問題のナビゲーションバーは、メインヘッダーイメージの下にあり、「約」、「仕事」、「リーダーシップ」、「場所」の4つのボタンがあります。
// HTMLドキュメント
</head>
<!-- HEADER IMAGE AND NAVIGATION BAR -->
<body onload="MM_preloadImages('images/nav_mouseover_LEADERSHIP.gif','images/nav_mouseover_JOBS.gif','images/nav_mouseover_LOCATION.gif')">
<div id = "bgtop">
<table width="960" border="0" align="center">
<tr>
<td><img src="images/header_ABOUT.jpg" width="960" height="240" alt="about" /></td>
</tr>
</table>
</div>
<div id = "greyBackground">
<table class = "buttons" width="960" border="0" align="center">
<tr>
<td width = 160 >
</td>
<td width = 80><img src="images/nav_selected_ABOUT.gif" width="80" height="25" alt="about" /></td>
<td width = 160>
<a href="leadership.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('leadership','','images/nav_mouseover_LEADERSHIP.gif',1)"><img src="images/nav_static_LEADERSHIP.gif" alt="leadership" name="leadership" width="160" height="25" border="0" id="leadership" /></a></td>
<td width = 80>
<a href="jobs.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Jobs','','images/nav_mouseover_JOBS.gif',1)"><img src="images/nav_static_JOBS.gif" alt="Jobs" name="Jobs" width="80" height="25" border="0" id="Jobs" /></a></td>
<td width = 80>
<img src="images/nav_static_JOBS_bumper_right.gif" width="160" height="25" /></td>
<td width = 160>
<a href="location.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('location','','images/nav_mouseover_LOCATION.gif',1)"><img src="images/nav_static_LOCATION.gif" alt="location" name="location" width="160" height="25" border="0" id="location" /></a></td>
<td>
<img src="images/nav_static_LOCATION_bumper_right.gif" width="160" height="25" /></td>
</tr>
</table>
// 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];
}
}
// CSSドキュメント
body {
margin: 0px;
}
html, table, tr, td
{
padding: 0;
border: 0;
font-family: Tahoma, Geneva, sans-serif;
font-size: 100%;
border-collapse: collapse;
border-spacing: 0;
vertical-align: baseline;
margin-top: 0px;
}
footer, header, hgroup, menu, nav, section
{
display: block;
}
ol, ul {
list-style: disc;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
background-color: #fff;
}
#footer
{
color:#9D0000;
}
#footerTitle
{
color: #9D0000 ;
font-weight: bold;
}
.buttons
{
padding: 0; border-collapse: collapse; border: 0;
}
.buttons img {
display: block;
}
.title
{
font-weight:bold;
}
/* BACKGROUNDS */
#bgtop{
background-image: url(images/gridBackground.gif);
}
#greyBackground{
background-image: url(images/greyBackground.gif);
background-repeat:repeat-y;
/* background-color: bfbfbf; */
}
#foot
{
background-image: url(images/footerGradient.gif);
}
.img{
display:block;
}