Up again with variables things I'm not ease with those yet ^^
I'm trying to make a photo gallery seamless to the simpleviewer only using xml cause the flash ones doesn't work like I want it to.
I know how to get this "plugin" work but my code wouldn't be dry and it could be usefull for lots of people.
Here were I am from now on :
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<!-------------------------------------- Background Image -------------------------------------------->
<plugin name="photogallerybackground" url="../imgs/black.png" align="center" width="80%" height="80%" keep="true" visible="true" handcursor="false" />
<!-------------------------------------- Thumb area -------------------------------------------->
<plugin name="photogallerythumbstage" url="../imgs/transparent.png" align="left" edge="left" x="0" y="0" parent="photogallerybackground" width="33%" height="100%" keep="true" visible="true" handcursor="false" />
<!-------------------------------------- The first 3 ones -------------------------------------------->
<plugin name="thumb1" url="../photos/thumbs/01.jpg" align="lefttop" edge="lefttop" width="25%" height="prop" parent="photogallerythumbstage" x="10%" y="10%" keep="true" visible="true"
onover="showphoto();" onout="hidephoto();"/>
<plugin name="thumb2" url="../photos/thumbs/02.jpg" align="lefttop" edge="lefttop" width="25%" height="prop" parent="photogallerythumbstage" x="40%" y="10%" keep="true" visible="true" />
<plugin name="thumb3" url="../photos/thumbs/03.jpg" align="lefttop" edge="lefttop" width="25%" height="prop" parent="photogallerythumbstage" x="70%" y="10%" keep="true" visible="true" />
<!-------------------------------------- The photos to be shown-------------------------------------------->
<plugin name="photogallerystage" url="../imgs/black.png" align="right" edge="right" x="0" y="0" parent="photogallerybackground" width="60%" height="100%" keep="true" visible="true" handcursor="false" />
<plugin name="photo1" url="../photos/01.jpg" align="righttop" edge="righttop" width="80%" height="prop" parent="photogallerystage" x="10%" y="10%" keep="true" visible="false" />
<plugin name="photo2" url="../photos/02.jpg" align="righttop" edge="righttop" width="80%" height="prop" parent="photogallerystage" x="10%" y="10%" keep="true" visible="false" />
<plugin name="photo3" url="../photos/03.jpg" align="righttop" edge="righttop" width="80%" height="prop" parent="photogallerystage" x="10%" y="10%" keep="true" visible="false" />
<!-------------------------------------- Actions to make the photos visible -------------------------------------------->
<action name="showphoto">
set(plugin[photo1].visible, true);
</action>
<action name="hidephoto">
set(plugin[photo1].visible, false);
</action>
...
|
Here it would work, just have to continue coding with repeated action for showing the right photo according to the thumb hovered...
But that makes a lot of coding for a simple action :'(
I'm trying to do something like :
<plugin name="photo" url="" align="righttop" edge="righttop" width="80%" height="prop" parent="photogallerystage" x="10%" y="10%" keep="true" visible="false" />
<action name="showphoto">
set(plugin[photo].url, ../photos/01.jpg);
set(plugin[photo].visible, true);
...
</action>
But as you see it'll be moreover complicated this way and not much dryer ^^
I'm a bit lost.
I miss the part to make only one action that loads different photo from a different thumb, without having to create as many actions as there are thumbs...
Would be great if someone could give me a clue here ^^
Thanks in advance.
At least when done it'll be a good xml plugin to share

Best regards.