Page 1 of 1

Displaying div on top of gallery works in 2.5 but not in 2.6

Posted: 14 Feb 2011, 15:41
by bobhamers
Hi,

I just updated from 2.5 to the new 2.6 version and noticed that adding the wmode: transparent to the gallery template doesn't work anymore for displaying custom html elements on top of the gallery.


I've placed a div with some icons just above the start of the table in "index.gallery.phtml" using the following code:
Code
<style type="text/css">
        .icons img {margin-top: 15px; padding-right:8px; border-style:none;}
        .icons {padding-right: 17px; position: absolute; top: 0; right: 0; color: #fff;}
</style>
</head>
<body>
<div class="icons"> <!-- Icons: metrostation-3025 -->
    <a href="#/content/"><img title="Home" src="ico/home.png"></a>
    <a href="#/content/about/"><img title="About" src="ico/info.png"></a>
    <a href="http://www.facebook.com/xxxxxxx" target="_new"><img title="Facebook"src="ico/facebook.png"></a>
    <a href="#/content/contact/"><img title="Contact" src="ico/email.png"></a>
</div>
<table>
In v2.5 I used this code (only added wmode) which worked perfectly
Code
swfobject.embedSWF("<?php echo IV_PATH; ?>imagevue2.swf", "imagevue", "100%", "100%", "8.0.0", "<?php echo IV_PATH; ?>expressInstall.swf", flashVars, {allowScriptAccess: 'always', wmode: 'transparent', allowFullScreen: true, bgcolor: '#<?php echo $this->bkGrColor; ?>'}, {id: 'imagevue', name: 'imagevue'});
The new code has changed slightly, so I have added the wmode setting to the params var above the SWFloader:
Code
params={allowScriptAccess: 'always', wmode: 'transparent', allowFullScreen: true, bgcolor: '#<?php echo $this->bkGrColor; ?>'};
I see there is a separate one for IE that has wmode: opaque as the setting. I guess this has to do with the wmode changes relating to the new sharing services?

Am I doing something wrong here or is there another way I could solve this?

Any help would be greatly appreciated
Bob

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 15 Feb 2011, 00:04
by Nick
Don't use transparent, just remove <-- if [IE] --> comments around the <script> with wmode:opaque and it will do the trick.

We thought we could go with opaque being set only for IE but the rabbit hole went deeper unfortunately.

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 15 Feb 2011, 03:45
by bobhamers
Just tried it, but still not working. The only thing that seems to have changed since 2.5 is that it's not responding to the wmode setting. When I inserted that in 2.5 it worked perfectly.

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 15 Feb 2011, 04:18
by mjau-mjau
bobhamers wrote:Just tried it, but still not working. The only thing that seems to have changed since 2.5 is that it's not responding to the wmode setting. When I inserted that in 2.5 it worked perfectly.
Do you have a link to your gallery? It is not like we can control wmode or div on top of flash in any way - Either wmode is set or its not.

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 15 Feb 2011, 04:20
by bobhamers

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 15 Feb 2011, 04:43
by mjau-mjau
Apparently, this is not wmode related. Just add z-index to your custom .icons {} class:
Code
z-index: 4;

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 15 Feb 2011, 08:45
by bobhamers
Ah, thanks! It works.

Should have thought of that, but didn't need it in the previous version so it just didn't occur to me.
Don't need the wmode change at all now.


Thanks a bunch!




EDIT:

Firefox does seem to need the wmode: opaque setting. Deleted the IE conditional and works like a charm cross browser!

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 15 Feb 2011, 10:49
by mjau-mjau
We need to look into wmode again, and in which browsers/platforms it is applied.

The problem, is that there is a bug were mousewheel functionality is disabled when wmode is enabled.

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 15 Feb 2011, 11:15
by bobhamers
Ah, I figured, because I keep getting a js error

'swfmacmousewheel' is undefined


Doesn't seem to hurt anything though.

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 18 Feb 2011, 01:30
by Nick
What is the browser you use? This error is appearing in IE but there are conditional comments around <script src> so you shouldn't be seeing this.

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 18 Feb 2011, 06:27
by mjau-mjau
pain wrote:What is the browser you use? This error is appearing in IE but there are conditional comments around <script src> so you shouldn't be seeing this.
It is not the <script src>, it is this:
Code
swfmacmousewheel.registerObject(attributes.id);

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 18 Feb 2011, 09:14
by bobhamers
I'm using IE, but it's not the conditional script. It still happens when I remove it completely.
Also getting an error in Firefox though:

Error: swfmacmousewheel is null
Source: http://home.bobhamers.nl/#/content/
Line: 168

That has to do with the line mjau-mjau mentioned.

Re: Displaying div on top of gallery works in 2.5 but not in

Posted: 18 Feb 2011, 09:50
by Nick
Right, sorry about this, just added the fix to the code for the next version. If you want to get rid of this, do the following.

Replace

swfmacmousewheel.registerObject(attributes.id);
With:

if (swfmacmousewheel)
swfmacmousewheel.registerObject(attributes.id);

in /iv-includes/templates/gallery.index.phtml