Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Flash & lightbox graphic gallery issue
Old 12-12-2007, 12:18 PM Flash & lightbox graphic gallery issue
tonya's Avatar
Ultra Talker

Posts: 485
Location: world traveller based in UK
Trades: 0
I am not sure where to post this query!

http://www.bitsmail.co.uk/Treherne/home.html

A while ago I posted a query up looking for some great gallery code & settled (thanks ladynRed) on lightbox code by Lokesh Dhakar.

You click an image and some javascript overlays a dark fade over the page picking a larger graphic and placing it over your page center screen with a message - click to close (later version also has a scroll)

My problem is that I use some flash graphics (flash bar on three pages) and for some reason this conflicts with the gallery code.

Is this something I can fix using z index (tried & failed but may not have got it right) or is it a javascript thing ???

I have emailed Lokesh but thought I would add a post anyway !!

Regards

If you want the css code here it is
Quote:
#lightbox{
background-color:#eee;
padding: 10px;
border-bottom: 2px solid #666;
border-right: 2px solid #666;
}
#lightboxDetails{
font-size: 0.8em;
padding-top: 0.4em;
}
#lightboxCaption{ float: left; }
#keyboardMsg{ float: right; }
#closeButton{ top: 5px; right: 5px; }

#lightbox img{ border: none; clear: both;}
#overlay img{ border: none; }

#overlay{ background-image: url(overlay.png); }

* html #overlay{
background-color: #333;
back\ground-color: transparent;
background-image: url(overlay.png);
background-image:url(blank.gif);
filter: progidXImageTransform.Microsoft.AlphaImageLoader (src="overlay.png", sizingMethod="scale");
}
__________________
Tonya

::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE

Last edited by tonya; 12-12-2007 at 12:19 PM.. Reason: css code
tonya is offline
Reply With Quote
View Public Profile Visit tonya's homepage!
 
 
Register now for full access!
Old 12-12-2007, 12:19 PM Re: Flash & lightbox graphic gallery issue
tonya's Avatar
Ultra Talker

Posts: 485
Location: world traveller based in UK
Trades: 0
Should this have gone in the javascript forum ???
__________________
Tonya

::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
tonya is offline
Reply With Quote
View Public Profile Visit tonya's homepage!
 
Old 12-12-2007, 12:22 PM Re: Flash & lightbox graphic gallery issue
tonya's Avatar
Ultra Talker

Posts: 485
Location: world traveller based in UK
Trades: 0
Here is the javascrip that defines the elements

Quote:
var objBody = document.getElementsByTagName("body").item(0);

// create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
var objOverlay = document.createElement("div");
objOverlay.setAttribute('id','overlay');
objOverlay.onclick = function () {hideLightbox(); return false;}
objOverlay.style.display = 'none';
objOverlay.style.position = 'absolute';
objOverlay.style.top = '0';
objOverlay.style.left = '0';
objOverlay.style.zIndex = '90';
objOverlay.style.width = '100%';
objBody.insertBefore(objOverlay, objBody.firstChild);

var arrayPageSize = getPageSize();
var arrayPageScroll = getPageScroll();

// preload and create loader image
var imgPreloader = new Image();

// if loader image found, create link to hide lightbox and create loadingimage
imgPreloader.onload=function(){

var objLoadingImageLink = document.createElement("a");
objLoadingImageLink.setAttribute('href','#');
objLoadingImageLink.onclick = function () {hideLightbox(); return false;}
objOverlay.appendChild(objLoadingImageLink);

var objLoadingImage = document.createElement("img");
objLoadingImage.src = loadingImage;
objLoadingImage.setAttribute('id','loadingImage');
objLoadingImage.style.position = 'absolute';
objLoadingImage.style.zIndex = '150';
objLoadingImageLink.appendChild(objLoadingImage);

imgPreloader.onload=function(){}; // clear onLoad, as IE will flip out w/animated gifs

return false;
}

imgPreloader.src = loadingImage;

// create lightbox div, same note about styles as above
var objLightbox = document.createElement("div");
objLightbox.setAttribute('id','lightbox');
objLightbox.style.display = 'none';
objLightbox.style.position = 'absolute';
objLightbox.style.zIndex = '100';
objBody.insertBefore(objLightbox, objOverlay.nextSibling);

// create link
var objLink = document.createElement("a");
objLink.setAttribute('href','#');
objLink.setAttribute('title','Click image to close');
objLink.setAttribute('alt','Click image to close');
objLink.onclick = function () {hideLightbox(); return false;}
objLightbox.appendChild(objLink);

// preload and create close button image
var imgPreloadCloseButton = new Image();

// if close button image found,
imgPreloadCloseButton.onload=function(){

var objCloseButton = document.createElement("img");
objCloseButton.src = closeButton;
objCloseButton.setAttribute('id','closeButton');
objCloseButton.style.position = 'absolute';
objCloseButton.style.zIndex = '200';
objLink.appendChild(objCloseButton);

return false;
}

imgPreloadCloseButton.src = closeButton;

// create image
var objImage = document.createElement("img");
objImage.setAttribute('id','lightboxImage');
objLink.appendChild(objImage);

// create details div, a container for the caption and keyboard message
var objLightboxDetails = document.createElement("div");
objLightboxDetails.setAttribute('id','lightboxDeta ils');
objLightbox.appendChild(objLightboxDetails);

// create caption
var objCaption = document.createElement("div");
objCaption.setAttribute('id','lightboxCaption');
objCaption.style.display = 'none';
objLightboxDetails.appendChild(objCaption);

// create keyboard message
var objKeyboardMsg = document.createElement("div");
objKeyboardMsg.setAttribute('id','keyboardMsg');
objKeyboardMsg.innerHTML = '<a href="#" onclick="hideLightbox(); return false;"><kbd>Click image to close</kbd></a>';
objLightboxDetails.appendChild(objKeyboardMsg);


}
As far as I can see z-index has been set from 90 to 200 on various elements of the gallery so I figured if I set the flash graphic to Z index 5 it would work but it doesnt !!! WHY ????
__________________
Tonya

::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
tonya is offline
Reply With Quote
View Public Profile Visit tonya's homepage!
 
Old 12-12-2007, 01:36 PM Re: Flash & lightbox graphic gallery issue
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I would definately ask in the javascript forumn how to make that flash image go away and replace it with a static image, when the gallery is accessed. My first guess is that the flash applet is hopelessly on top. It would be nice, stylistically to have the flash revert to a still image when the gallery pops open anyway.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 12-12-2007, 04:04 PM Re: Flash & lightbox graphic gallery issue
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
I'm not surprised this doesn't work, not even with Z-index.
You might try hiding the flash when you fire up the lightbox, display:none on a div with the flash in it might work.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-13-2007, 11:49 AM Re: Flash & lightbox graphic gallery issue
Junior Talker

Posts: 4
Name: Gabriel
Trades: 0
I had this problem 2 days ago ... I just used a transparent parameter for my flash ... it worked like a charm

there is nothing wrong with the lightbox script ...

Hope this helps
Morp4 is offline
Reply With Quote
View Public Profile
 
Old 12-14-2007, 09:03 AM Re: Flash & lightbox graphic gallery issue
tonya's Avatar
Ultra Talker

Posts: 485
Location: world traveller based in UK
Trades: 0
ok Morp4 - How do I implement that please - can you give me an example of where I put that in script

LadynRed - same please - where would i place div ? around flash - how do I ensure its visible when page in normal but set to none when gallery implemented - do I put it in the gallery CSS code ???
__________________
Tonya

::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
tonya is offline
Reply With Quote
View Public Profile Visit tonya's homepage!
 
Old 12-14-2007, 11:41 AM Re: Flash & lightbox graphic gallery issue
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
If you have the source for the Flash, you can set the Window Mode to Transparent when you Publish to SWF. If not, you can add the window=transparent to the parameters on the flash object code.

Yes, put a div around the flash content. I'd try the transparent setting first, it may work and the div and display:none won't be necessary. If that doesn't work, I think you'd have to change the visibility in the Javascript - and I'm not good enough at JS to tell you how to do that, I've just seen it suggested for similar problems with flash.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-14-2007, 02:20 PM Re: Flash & lightbox graphic gallery issue
tonya's Avatar
Ultra Talker

Posts: 485
Location: world traveller based in UK
Trades: 0
Ok I tried this

Quote:
<div class="flashdisplay"><object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="790" height="100" title="Treherne House Quality Accommodation" window="transparent">
<param name="movie" value="Images/Flash/Treherne-house-flash.swf" />
<param name="quality" value="high" />
<embed src="Images/Flash/Treherne-house-flash.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="790" height="100" window="transparent"></embed>
</object></div>
no joy

the display:none made everything disappear so I must have to set that class to only activate when lightbox is active -

think ultimately its a javascript thing - but had no reply from developer so stuck !
__________________
Tonya

::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
tonya is offline
Reply With Quote
View Public Profile Visit tonya's homepage!
 
Old 12-14-2007, 02:50 PM Re: Flash & lightbox graphic gallery issue
tonya's Avatar
Ultra Talker

Posts: 485
Location: world traveller based in UK
Trades: 0
Its fixed

LadynRed you were absolutely right the code however was just off -

This is what you need to do

"The background of a Flash movie can be set to transparent. This allows the background color or image of the HTML page that contains the Flash movie to show through and allows the layering of Flash content with DHTML content. "

You can do this in flash or edit the HTMl directly which is what I did by adding these two pieces of code

1 - add the following parameter to the OBJECT tag:
Quote:
<param name="wmode" value="transparent">
2 - Add the following parameter to the EMBED tag:
Quote:
wmode="transparent"
It works great !!!
__________________
Tonya

::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
tonya is offline
Reply With Quote
View Public Profile Visit tonya's homepage!
 
Old 12-14-2007, 02:58 PM Re: Flash & lightbox graphic gallery issue
Extreme Talker

Posts: 238
Location: United States
Trades: 0
The troubleshooting section of the Lightbox site for this Flash issue points users to a comment which points users to this forum thread. Basically, it looks the solution is actually just HTML-based. It appears the window mode attribute might be wmode, not window.

HTML Code:
<param name="wmode" value="transparent" />
<embed src="Images/Flash/Treherne-house-flash.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="790" height="100" wmode="transparent"></embed>
Hope that works.

Edit: Oops, guess you already found the solution while I was posting this!
__________________
The interlocking pieces of web development: usability, performance, accessibility, and standards.

Last edited by frost; 12-14-2007 at 03:00 PM.. Reason: I'm slow
frost is offline
Reply With Quote
View Public Profile
 
Old 12-15-2007, 09:48 AM Re: Flash & lightbox graphic gallery issue
tonya's Avatar
Ultra Talker

Posts: 485
Location: world traveller based in UK
Trades: 0
Hi there - the only problem is this does not work in ie !!!

Works fine in firefox just not ie !!

any one offer a suggestion ??
__________________
Tonya

::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
tonya is offline
Reply With Quote
View Public Profile Visit tonya's homepage!
 
Old 12-15-2007, 09:55 AM Re: Flash & lightbox graphic gallery issue
tonya's Avatar
Ultra Talker

Posts: 485
Location: world traveller based in UK
Trades: 0
Ok I discovered to ensure it works in IE you need to add a third step

3 - add this additional param

Quote:
<param name="wmode" value="transparent" />
This now works in IE & firefox / opera etc !! yahoo !! (thanks frost for that last comment!)

Thanks to all
__________________
Tonya

::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
tonya is offline
Reply With Quote
View Public Profile Visit tonya's homepage!
 
Old 12-15-2007, 11:53 AM Re: Flash & lightbox graphic gallery issue
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Sorry for the goof on the wmode.. it's been a while since I've had to do it.. lol. At least you got it working
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-15-2007, 11:57 AM Re: Flash & lightbox graphic gallery issue
tonya's Avatar
Ultra Talker

Posts: 485
Location: world traveller based in UK
Trades: 0
hey no problem - you are a complete star anyway - helped me out of many wee messes & at least pointed me in the right direction. I mis-understood the directions previously but it now works in all browsers & once the footer is sorted will be probably my favorite piece of work to date ! The customer loves it which is the main thing & I am really happy to present it as an example of my work . Thanks

p.s my baby was 2 on friday - time flies !!!
__________________
Tonya

::
Please login or register to view this content. Registration is FREE
::
Please login or register to view this content. Registration is FREE
tonya is offline
Reply With Quote
View Public Profile Visit tonya's homepage!
 
Reply     « Reply to Flash & lightbox graphic gallery issue
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.47258 seconds with 12 queries