我有一个经典的ASP VBScript页面的问题,它开始让我感到烦恼。为了记录,我不是网页设计师,我正在研究别人的代码。
我有一个奇怪的问题,即无法点击直接出现在标题下的第一组链接,但是在第一行之后的任何链接都可以。我认为这是页面上重叠元素的某种问题,但是,经过2个小时的尝试修复后,我得到了答案。
下面的例子来自创建标题的循环(第一个循环)。关于为什么会发生这种情况的任何想法都会很棒。
由于
<div id="folderWrapper" style="width:100%; text-align:left; display:inline; float:left;">
<!-- Loop through the folders in the specific directories to find all that start with a "_" (where documents are stored) -->
<%
dim fs,fo,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder(server.MapPath(department))
for each x in fo.SubFolders
%>
<%If Left(x.Name, 1) = "_" Then%>
<!-- Run the loop against only folders with the appendix of "_" as these are the folders with the files in.-->
<div id="folderDiv" style="width:100%; text-align:left; display:inline; float:left; padding-right:10px;">
<!-- Create headers for each folder-->
<h6><%Response.Write(Right(x.Name,len(x.Name)-1))%></h6>
<%
' Loop through files in folder
dim fs2,fo2,x2
set fs2=Server.CreateObject("Scripting.FileSystemObject")
set fo2=fs2.GetFolder(x)
for each x2 in fo2.files
' Set fileType variable depending upon the left 4 or 5 chars.
dim fileType
If (Right(x2.Name,4)=".doc") or (Right(x2.Name,4)=".pdf") Then
fileType = Right(x2.Name,4)
End If
If (Right(x2.Name,5)=".docx") Then
fileType = Right(x2.Name,5)
End If
%>
<!-- DIV to contain the files and display the correct icon for .doc/.docx and .pdf files-->
<div id="fileDiv" style="width:450px; float:left; display:inline; margin-left:10px; background-image:url(../images/<%if (right(x2.Name,4) = ".doc") or (right(x2.Name,4) = "docx") then %>Word_Icon.gif <%end if%> <%if(right(x2.Name,4) = ".pdf") then %>PDF_Icon.gif <% end if %> ); background-position:left; background-repeat:no-repeat; padding:10px 10px 10px 25px;" >
<%If fileType <> ".db" Then%>
<!-- If to deal with .doc and .pdf files (removes the .doc/.pdf extensions from the name when displayed on the page)-->
<%If (fileType=".doc") or (fileType=".pdf") Then%>
<a href="./<%Response.Write(department) %>/<%=x.Name%>/<%=x2.Name%>" target="Form"><%=left(x2.Name,len(x2.Name)-4)%></a>
<%End If%>
<!-- If to deal with .docx files (removes the .docx extensions from the name when displayed on the page)-->
<%If (fileType=".docx") Then %>
<a href="./<%Response.Write(department)%>/<%=x.Name%>/<%=x2.Name%>" target="Form"><%=left(x2.Name,len(x2.Name)-5)%></a>
<%End If%>
<%End If%>
</div>
<%next
set fo=nothing
set fs=nothing%>
<p> </p>
<p> </p>
</div>
<%End If%>
<%next
set fo=nothing
set fs=nothing%>
</div>
答案 0 :(得分:0)
这是由于标签与第一个div重叠造成的。这最初是为了在div之前和div之间提供一个缓冲区,但是这个被删除了,而是添加了填充。