Topic: gallery.xml change with the click of a link

Hi, im using the code for the basic_embed.html to display my gallery, it works fine. The problem i have is i need 4 links, changing the pictures, so when i click the 1st link the first 1-16 pictures show, then link 2 the next 17-32 show. What would the easiest way to do this be? As far as i can tell the 2 ways i can do it, 1) Make is so the link replaces the gallery.xml file or 2) make it so the link scrolls along on the viewer to 17-32 and have all the photos on 1 gallery file. I dont know if any of these are possible/an easier way to do it but any help/advice is appreciated.

Many thanks
Tom

Last edited by tomhart (2010-03-24 11:10:25)

Re: gallery.xml change with the click of a link

ok ive messed around and ive come up with this, but it doesnt work

    <script type="text/javascript">
    var flashvars = {} ;
            flashvars.galleryURL = "gallery1.xml";
            function flashvars () {
            flashvars.galleryURL = "gallery.xml";}
</script>
<body>
<a href="#" onClick="flashvars()">Changed</a>
</body>

Can anyone help point me in the right direction?

Re: gallery.xml change with the click of a link

Sounds like you want to have multiple galleries and use a HTML menu to switch between them. Check instructions here.

Felix Turner
SimpleViewer Support Team.

Re: gallery.xml change with the click of a link

Thats almost right. I need 2+ galleries on 1 page, but not in seperate objects. http://www.simpleviewer.net/simpleviewe … _one_page/ i need it like that but when i click a link, the original pictures are replaced with new ones, if that makes sense hmm.

EDIT: I just had an idea, what if i put all the galleries on one page in divs, then make the link hide/show certains divs. You think that could work?

Last edited by tomhart (2010-03-24 20:24:22)

Re: gallery.xml change with the click of a link

I got this but it doesnt seem to work

<a href="java script:showDiv1()">Show 1</a> 
<a href="java script:hideDiv1()">show 2</a>

<div id="hideshow">
<h2>Gallery 1</h2>
<!--  Gallery 1 Div -->
<div id="flashContent1">SimpleViewer requires JavaScript and the Flash Player. <a href="http://get.adobe.com/flashplayer/">Get Flash</a></div>
</div>

only the title gallery 1 title dissapears and not the div flashContent1. Anyone see a problem with the code?

If you need me to post the java code for the hide/show let me know.

Thanks
Tom

Re: gallery.xml change with the click of a link

Ok to get the effect i want i think im gonna use a div hide/show
The JS

var flashvars = {};
            flashvars.galleryURL = "gallery2.xml";
            var params = {};    
            params.allowfullscreen = true;
            params.allowscriptaccess = "always";
            params.wmode = "transparent";
            swfobject.embedSWF("simpleviewer.swf", "flashContent2", "600", "550", "9.0.124", false, flashvars, params); 


function hideDiv1() {
document.getElementById('hideshow').style.visibility = 'hidden';
document.getElementById('hideshow1').style.visibility = 'visible';
}

function showDiv1() {
document.getElementById('hideshow').style.visibility = 'visible';
document.getElementById('hideshow1').style.visibility = 'hidden';
}

the HTML

<a href="javascript:showDiv1()">Show 1</a> 
        <a href="javascript:hideDiv1()">show 2</a>
        <div id="hideshow">
        <div style="position:absolute; left:100px; top:35px;"><h2>Gallery 1</h2></div>
        
        <!--  Gallery 1 Div -->
          <div id="flashContent1" wmode="transparent" >SimpleViewer requires JavaScript and the Flash Player. <a href="http://get.adobe.com/flashplayer/">Get Flash</a></div></div>
         <div id="hideshow1">
        <div style="position:absolute; left:100px; top:35px;"><h2>Gallery 2</h2></div>
       
        <!--  Gallery 2 Div -->

        <div id="flashContent2">SimpleViewer requires JavaScript and the Flash Player. <a href="http://get.adobe.com/flashplayer/">Get Flash</a></div>
        </div> 

For some reason the hide/show only toggles the heading and not the flash, if i put a wmode trasparent in the flash javascript the object dissapears and displays the you need flash player text. Anyone see why?

P.S sorry if this post makes no sense im very tired smile