Loops coldfusion循环正在删除链接

Loops coldfusion循环正在删除链接,loops,hyperlink,coldfusion,Loops,Hyperlink,Coldfusion,我有一个在我的网页上的图形,并将强加在它的一些链接 <p><img src = "ind-pict-05.png" alt = "ind-pict-05.png" class = "webresponsive" style = "width:100%; position:relative; z-index:0; "><

我有一个在我的网页上的图形,并将强加在它的一些链接

  <p><img src = "ind-pict-05.png" alt = "ind-pict-05.png" 
       class = "webresponsive" 
       style = "width:100%; position:relative;
                z-index:0;  "></p>
       <div style = "position:absolute;top:15%;left:59%;width:16%;height:81%;
               z-index:1;border:2px solid blue">
          <div class = 'rainbow'>
          <a style = "cursor:pointer" onclick = "window.open('ind-acct.cfm')"></a></div>
         
          <div class = 'rainbow'
          <a style = "cursor:pointer" onclick = "window.open('ind-donor.cfm')"></a></div>
    </div> 
这很有效

在图中,蓝色框显示所有内容都已正确定位,红色框(包含链接的div)也显示正确定位。(这些调试工具将在最终版本中删除。)链接工作正常

最终会有12个红色的盒子,所以我想我会把它放在一个循环中。仅使用两个框进行尝试,代码为:

     <cfset linkarr = ListToArray('acct,donor')>  
     <p><img src = "ind-pict-05.png" alt = "ind-pict-05.png" 
       class = "webresponsive" 
       style = "width:100%; position:relative;
                z-index:0;  "></p>
     <div style = "position:absolute;top:15%; left:59%;width:16%;height:81%;
               z-index:1;border:2px solid blue">
     <cfoutput>
         <cfloop array = '#linkarr#' index = 'abc'>               
             <div class = 'rainbow;'>
                <a style = "cursor:pointer" onclick = "window.open('ind-#abc#.cfm')"></a>
             </div>              
         </cfloop>
   </cfoutput>

开发人员工具显示了代码,但除了从顶部div继承的内容(此处未显示)之外,它没有显示任何格式:


有谁能告诉我为什么写出每个链接都是有效的,但是通过链接循环是无效的?

问题不在于循环,而在于它内部和外部的html。如果比较这两种方法生成的html,您将看到它们的区别

其他人已经指出,在CF方法中,类名称后面有一个错误的分号:

另外两个问题:

您错过了CF版本上的关闭外部

@Thum Choon-Tat说得对,没有内容的链接没有宽度和高度。 在纯html方法中,您错过了第二个内部div开启器上的


不正确。类名中没有分号。同样,将列表转换为数组也没有多大意义。你可以直接使用
Tomalak,是的,是坏的类使红色边框消失了——我想我自动键入了很多;只是因为javascript。然而,链接仍然不存在。还有什么想法吗?将列表重新设置为数组,旨在循环列表,但出现了一些奇怪的错误,因此我尝试使用数组。不知道这些是否相关。您需要红色框中的链接才能单击?链接有什么样式吗?没有任何内容的链接的宽度和宽度为0height@ThumChoonTat--当我不使用循环时,链接工作正常。他们工作时考虑到了div.Sev,毫无疑问你是对的,我把html搞乱了。我很快就会查出来的。很难看出自己的错误。关于零宽度,零高度:链接在整个Sev中工作,我已经检查过了。我将其放回非循环部分的missing>中,链接无法执行。我想我以前也经历过这种经历。继Thum Choon关于空div没有大小的观点之后,我在里面放了一些东西。这没用。没有>它工作得很好。不过,我真的很想修复它,因为虽然它在firefox中工作,但在其他浏览器中可能无法工作
     <cfset linkarr = ListToArray('acct,donor')>  
     <p><img src = "ind-pict-05.png" alt = "ind-pict-05.png" 
       class = "webresponsive" 
       style = "width:100%; position:relative;
                z-index:0;  "></p>
     <div style = "position:absolute;top:15%; left:59%;width:16%;height:81%;
               z-index:1;border:2px solid blue">
     <cfoutput>
         <cfloop array = '#linkarr#' index = 'abc'>               
             <div class = 'rainbow;'>
                <a style = "cursor:pointer" onclick = "window.open('ind-#abc#.cfm')"></a>
             </div>              
         </cfloop>
   </cfoutput>