View Full Version : Form Box showing thru image, set opacity?

07-30-2006, 03:56 PM
Script: Image Thumbnail Viewer
URL on DD: http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm

Describe Problem:
Great script however one question. I have a couple of dropdown boxes on the same page as the gallery, and the boxes are showing "thru" the image. Is there anyway to change the transparency/opacity of the window?

An example can be seen here, as the "Curency Converter" box is seen thru the image and even works "thru" the image.


07-30-2006, 04:21 PM
Well, what I don't understand here is how the boxes are showing through the image. Did you add a filter:

select {filter:alpha(Opacity=50)}
Because for one, you need to find the problem, and then you have to try to fix it.

07-30-2006, 06:02 PM
Thanks for the quick reply

I didn't add any type of filter to the image script. I really don't know what to look for to be causing the problem, that is why I am posting....

07-31-2006, 04:04 AM
Any other ideas on this one, as I really don't know what I should be looking for...
If it matters, this problem only happens with IE. The box does not show thru on Firefox or Opera.

07-31-2006, 04:11 AM
what type of browser are you using?

edit: oops, i missed that last bit.

I use have IE too, and it seems to be working fine

07-31-2006, 04:16 AM
Or even better yet, when this happens on your browser, hit print screen, upload it and let me see it. then I'll be able to see what's happening, because whatever the problem is, it's not happening in my browser.

07-31-2006, 04:21 AM
what type of browser are you using?

Problem is happening on IE 6.0 sp2.
Looks fine on opera9 and firefox

07-31-2006, 04:22 AM
Or even better yet, when this happens on your browser, hit print screen, upload it and let me see it. then I'll be able to see what's happening, because whatever the problem is, it's not happening in my browser.

Give me a few minutes and I will "get it up".

07-31-2006, 04:24 AM
Well, you can make it a file attachment on a post

07-31-2006, 04:26 AM
well, i have to go, i'll be back in about half an our

07-31-2006, 04:27 AM
Give me a few minutes and I will "get it up".

Here you go, I didnt want to insert too large an image, but this shows the issue, and the form box is usuable even thru the image.


07-31-2006, 05:54 AM
Replace Step 1 from the demo page with this:

<style type="text/css">

border: 1px solid #f5f5f5;

cursor: hand;
cursor: pointer;
background-color: #f5f5f5;
min-width: 100px; /*NS6 style to overcome bug*/

#dragbar #closetext{
font-weight: bold;
margin-right: 1px;

<!--[if lte IE 6]>
<!--[if gte IE 5.5]>
<iframe id="showimageiframe" src="" style="z-index:99;display:none;position:absolute;" frameborder="0"></iframe>

<script type="text/javascript">

* Image Thumbnail viewer- Dynamic Drive (www.dynamicdrive.com)
* Last updated Sept 26th, 03'. This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
* Modified to appear over selects in IE5.5 through IE6 by jscheuer1
* in http://www.dynamicdrive.com/forums 7/31/06
var ie5_5=typeof showimageiframe=='undefined'? 0 : 1
var showing=0
var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body

function enlarge(which, e, position, imgwidth, imgheight){
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (position=="center"){
pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
if (window.opera && window.innerHeight) //compensate for Opera toolbar
vertpos=Math.max(pgyoffset, vertpos)
var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY

crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()"><font color=#000000>CLOSE</font></span> </div><img src="'+which+'">'
return false
else //if NOT IE 4+ or NS 6+, simply display image in full browser window
return true

function closepreview(){

function drag_drop(e){
if (ie&&dragapproved){
else if (ns6&&dragapproved){
return false

function initializedrag(e){
if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY



document.onmouseup=new Function("dragapproved=false")

// Hide IFrame
function hideIframe() {
if (ie5_5){
var theIframe = document.getElementById("showimageiframe")
theIframe.style.display = "none";

// Unhide IFrame
function unhideIframe() {
if (ie5_5){
var theIframe = document.getElementById("showimageiframe")
var theDiv = document.getElementById("showimage");
theIframe.style.width = theDiv.offsetWidth+'px';
theIframe.style.height = theDiv.offsetHeight+'px';
theIframe.style.top = theDiv.offsetTop+'px';
theIframe.style.left = theDiv.offsetLeft+'px';
theIframe.style.display = "block";

07-31-2006, 10:45 AM
That worked perfectly!
You guys are awesome,thanks so much for your help at all hours of the morning.


07-31-2006, 11:19 AM
When using IE, this script now throws a "this page contains secure and nonsecure items" message. When I revert back to the old script which has the form showing thru, the error security warning disappears.

Any ideas what would be causing that warning in the script?

07-31-2006, 05:00 PM
It is hard to say exactly but, I would guess that you need to make up a blank page and give it the same security level as your page, and list it as the source of the iframe:

<!--[if lte IE 6]>
<!--[if gte IE 5.5]>
<iframe id="showimageiframe" src="secure_blank.html" style="z-index:99;display:none;position:absolute;" frameborder="0"></iframe>

Where secure_blank.html is the name of your secure blank page. The extension (.html) in my example may have to be different in order for it to truly be secure. Needless to say (I hope), working on this locally, I had no secure page to begin with so, didn't have this problem. You might be able to use:

<!--[if lte IE 6]>
<!--[if gte IE 5.5]>
<iframe id="showimageiframe" src="about:blank" style="z-index:99;display:none;position:absolute;" frameborder="0"></iframe>

Which would be better, if it works. It is possible that neither of these two approaches will work. If not, there may be no solution but, we could do some tests that will help us find a solution if one exists. Try the about:blank idea first. Then if that doesn't do it, make up a secure page for the iframe, let us know what happens.

07-31-2006, 05:50 PM
Hi John,

src="secure_blank.html" still showed a security warning when entering a secure page.

src="about:blank" caused my page to not show at all.


src="http://obscuria.make-a-store.com/cgi-bin/Make-a-Store.cgi" not only threw a security warning, but a copy of the "browse by price" dropdown was actually attached to the image, and when I dragged the image, it was a part of it.

Hmmm, any other ideas?

07-31-2006, 08:30 PM
Well, I got this message when trying to access secure_blank.html -

The requested URL /cgi-bin/secure_blank.html was not found on this server.

So, I have to ask, did you make up a blank page of that name (secure_blank.html) and upload it to the /cgi-bin/ directory?

If not, give it a shot. Otherwise, I would consult your documentation for your marketing package and/or ask the folks who make it how to make up a blank page that is secure. If you cannot get anywhere like that, find a forum for the package that you are using and ask there how to make up a blank secure page. Tell anyone you ask for help that you are showing it through an iframe on a secure page. If this cannot be done, we can devise a way to make the select invisible while the pop up image is visible but, that will not look as professional.

08-01-2006, 04:24 AM
Yes, I made up the page, but later deleted it after testing.
I reuploaded the page, link here:http://obscuria.make-a-store.com/cgi-bin/category.cgi?category=secure_blank

So again the gallery works fine now, but what happens is when adding an item to the cart and checking out I get a secure warning just by the script being between the head tags.....

08-01-2006, 04:43 AM
Why do you even have the script on the secure page? I see no gallery on it.

08-01-2006, 06:09 PM
"Why do you even have the script on the secure page? I see no gallery on it."

Because I put the script in the header template that is the same on every page. But in retrospect, I see that I could have just put the script in the product template pages that I need to use the gallery on.

I got with my shopping cart provider, they gave me the proper way to create and reference a secure page, and now the security warning is gone.

My apologizies for not realizing to just put the script on the same page as the gallery only the first time, but thank you for all of your excellent help.