[web] Cross browser problem using layers

Started by
3 comments, last by agm_ultimatex 16 years, 1 month ago
I currently have a layer created in an ASP string, and then sent into an iframe tag via &#106avascript. It contains a couple labels, a couple select boxes and a submit button. When I open the layer via hyperlink in the webpage(using IE 7). The labels are invisible (like if they were coloured the same as the background). When I highlight them they appear partially, and dissappear if i highlight the whole layer and a bit of the page. However, it renders completely fine in firefox. Any help on this would be appreciated.
Advertisement
Can you post some [HTML/JS/CSS] code, or maybe a link to an example?
I'll use simple filenames just for reference.

The asp code that creates the layer content (such as text boxes) (file2.asp):
If Request.QueryString("type") = 2 Then	LayerContent = LayerContent & "<p style=\'font-weight:bold\'>Create Knowledge Asset</p><div><span>Asset Name:</span><br /><input type=\'text\' name=newka /></div>"	LayerContent = LayerContent & "<div style=\'padding-top:10px;\'><span>Category Type: </span><br /><select name=kacatname><option value=0>Please Choose&hellip;</option>"	Set oRs2 = oConn.Execute("SELECT kacatID, kacatshort, kacatlong, kacatorder FROM kacat WHERE kacatownerid="& CurrentOwnerID &" ORDER BY kacatorder") 	Do While Not oRs2.EOF		LayerContent = LayerContent & "<option value="& oRs2(0) &">"& oRs2(1) &"</option>"	oRs2.MoveNext	Loop	LayerContent = LayerContent & "</select></div><div style=\'padding-top:10px;\'><label>Date Type:</label><br /><select name=dateflag>"	Set oRs3 = oConn.Execute("SELECT codeID, codetypeid, codedesc, codeorder, codevalue FROM codes WHERE codetypeid = 6 AND codeownerID="& CurrentOwnerID &" ORDER BY codeorder")	Do While Not oRs3.EOF			LayerContent = LayerContent & "<option value="& oRs3(4) &">"& oRs3(2) &"</option>"	oRs3.MoveNext	Loop	LayerContent = LayerContent & "</select></div><div style=\'padding-top:10px;\'><input type=submit name=action value=\'New\' />&nbsp;<input type=button onClick=HideContent(\'createcategory\') value=Cancel /></div></div></body></html>"End If


A bit of &#106avascript calling following that in the same page:
<body style="font:Courier;" onload="javascript:parent.document.getElementById('createcategory').innerHTML = '<% = LayerContent %>'; parent.ShowContent('createcategory');return true;"></body>


The &#106avascript functions that are used for the layer(file1.asp - which is the page that the link is &#111;n to open the layer): (I didn't write it, my boss did, and used it &#111;n a previous web app. The two last arithmetic statements i changed to static variables so the layer would pop up in &#111;ne place rather than where the mouse position is). <br><!--STARTSCRIPT--><!--source lang="javascript"--><div class="source"><pre><br><span class="cpp-keyword">function</span> HideContent(d) {<br><span class="cpp-keyword">if</span>(d.length &lt; [<span class="cpp-number">1</span>]) { <span class="cpp-keyword">return</span>; }<br>document.getElementById(d).style.display = <span class="cpp-literal">"none"</span>;<br>}<br><span class="cpp-keyword">function</span> ShowContent(d) {<br><span class="cpp-keyword">if</span>(d.length &lt; [<span class="cpp-number">1</span>]) { <span class="cpp-keyword">return</span>; }<br><span class="cpp-keyword">var</span> dd = document.getElementById(d);<br>AssignPosition(dd);<br>dd.style.display = <span class="cpp-literal">"block"</span>;<br>}<br><span class="cpp-keyword">function</span> ReverseContentDisplay(d) {<br><span class="cpp-keyword">if</span>(d.length &lt; [<span class="cpp-number">1</span>]) { <span class="cpp-keyword">return</span>; }<br><span class="cpp-keyword">var</span> dd = document.getElementById(d);<br>AssignPosition(dd);<br><span class="cpp-keyword">if</span>(dd.style.display == <span class="cpp-literal">"none"</span>) { dd.style.display = <span class="cpp-literal">"block"</span>; }<br><span class="cpp-keyword">else</span> { dd.style.display = <span class="cpp-literal">"none"</span>; }<br>}<br><span class="cpp-keyword">var</span> cX = [<span class="cpp-number">0</span>]; <span class="cpp-keyword">var</span> cY = [<span class="cpp-number">0</span>]; <span class="cpp-keyword">var</span> rX = [<span class="cpp-number">0</span>]; <span class="cpp-keyword">var</span> rY = [<span class="cpp-number">0</span>];<br><span class="cpp-keyword">function</span> UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}<br><span class="cpp-keyword">function</span> UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}<br><span class="cpp-keyword">if</span>(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }<br><span class="cpp-keyword">else</span> { document.onmousemove = UpdateCursorPosition; }<br><span class="cpp-keyword">function</span> AssignPosition(d) {<br><span class="cpp-keyword">if</span>(self.pageYOffset) {<br> rX = self.pageXOffset;<br> rY = self.pageYOffset;<br> }<br><span class="cpp-keyword">else</span> <span class="cpp-keyword">if</span>(document.documentElement &amp;&amp; document.documentElement.scrollTop) {<br> rX = document.documentElement.scrollLeft;<br> rY = document.documentElement.scrollTop;<br> }<br><span class="cpp-keyword">else</span> <span class="cpp-keyword">if</span>(document.body) {<br> rX = document.body.scrollLeft;<br> rY = document.body.scrollTop;<br> }<br><span class="cpp-keyword">if</span>(document.all) {<br> cX += rX; <br> cY += rY;<br> }<br>d.style.left = ([<span class="cpp-number">0</span>]) + <span class="cpp-literal">"px"</span>;<br>d.style.top = ([<span class="cpp-number">150</span>]) + <span class="cpp-literal">"px"</span>;<br>}<br><br></pre></div><!--ENDSCRIPT--><br><br>Then I use a div that has the id of createcategory and an iframe with the name contentFRM, which is targeted via the hyperlink. Both are in file1.asp<br><br>Also notice the asp statement If Request.QueryString("type") = 2 Then<br>theres another if above that where its = to 1. That generates different content for a different purpose, and works fine.
I don't have much experience with IE7 bugs yet (my company still uses IE6 as the standard) but does this describe your problem?

IE7 disappearing content bug
Yes it did, thank you very much :)

This topic is closed to new replies.

Advertisement