...

View Full Version : Displaying Documents



jax02
05-08-2007, 05:46 PM
I have a question regarding displaying documents on a website. I currently have a website which uses iframes to display word, excel and pdf files so users can either make changes to the document or print the document without having to dig through the server for the files. Recently though I changed the layout and design of the site and am now using side pop out menus which when you want to go to a sub menu will cause it to display behind the document. My understanding is that the documents are considered active objects and no matter waht will always be displayed on top. My question is there any other way to display this documents without using a iframe or a way to allow the menus to display over the content? The site it self is based off a CSS template and the menu uses a seperate CSS.

So far I have tried to treat the iframe as a transparent object, changed the z-index and a couple various other code changes, but frankly web development isnt my feild, so bare with me please =)

whizard
05-08-2007, 06:33 PM
An iframe is a GUI component and is always 'on-top'-- you can't fix it with z-index.

Unfortunatly, the only solutions seem to be not using an iframe, or moving the menu.

HTH
Dan

jax02
05-08-2007, 07:58 PM
Is there anything other method you could reccomend for displaying documents?

whizard
05-08-2007, 08:02 PM
open in a new window?

Dan

jax02
05-08-2007, 08:18 PM
That is kind of a last resort. The director who is over seeing this doesnt like multiple windows, thats why I tried the iframe approach. I will end up using that if I have to, but was hoping for another method of embedding objects. There wouldnt be anything in maybe php that would allow me to do this?

Thanks again for the help I appreciate it!

kosstr12
05-08-2007, 08:19 PM
If the file didn't have to be on the page, couldn't you put a link to it, then it would download and display itself...or just take screenshots of the files and put those on your site

jax02
05-09-2007, 04:00 PM
Thanks for the replies guys. I have come up with a solution. I used a onmouseover event so when a element of the menu that has sub menus is highlighted with the mouse the iframe will hide itself. This allows me to display the content that I need on the page and still be able to use the pop out menus.

Here is the code I used.

<div
id="feature"
style="display: none;">
<iframe
src="doc_owa.pdf"
scrollbars="auto"
width="100%"
height="500">
</iframe>
</div>

I put this with each menu link that has a sub-menu

<span
id="viewiframe"
onmouseover="DoViewIFRAME('viewiframe','hideiframe','owaiframe');"
style="line-height: 16px;
font-size: 14px;
font-weight: bold;
font-family: sans-serif;
color: brown;
background-color: gold;">
<nobr>[View IFRAME]</nobr>
</span>
<span
id="hideiframe"
onmouseover="DoHideIFRAME('hideiframe','owaiframe','viewiframe');"
style="display: none;
line-height: 16px;
font-size: 14px;
font-weight: bold;
font-family: sans-serif;
background-color: brown;
color: gold;">
<nobr>[Hide IFRAME]</nobr>
</span>

Lastly the Jacascript that makes it work

<script type="text/javascript" language="JavaScript"><!--
function DoViewIFRAME(tid1,tid2,tid3) {
document.getElementById(tid1).style.display = "none";
document.getElementById(tid2).style.display = "";
document.getElementById(tid3).style.display = "";
}
function DoHideIFRAME(tid1,tid2,tid3) {
document.getElementById(tid1).style.display = "none";
document.getElementById(tid2).style.display = "none";
document.getElementById(tid3).style.display = "";
}
//--></script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum