OK, I figured out a way to get the controls out of the gallery. Use these styles (the exact placement and styles of the #simpc1 division is up to you, these are the now mobile controls, they can go anywhere. If using more than one gallery, it's id must be unique to each gallery):
Code:
.navpanellayer {
position: static!important;
}
.navpanellayer div {
position: relative!important;
top: auto!important;
}
.navpanellayer div.navpanellayerfg {
top: -2px!important;
}
.navpanellayerbg {
display: none;
}
#simpc1 {
background-color: gray;
width: 150px;
float: right;
}
Add to the call for the gallery:
Code:
<script type="text/javascript">
var mygallery=new simpleGallery({
wrapperid: "simplegallery1", //ID of main gallery container,
dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
imagearray: [
["http://i26.tinypic.com/11l7ls0.jpg", "http://en.wikipedia.org/wiki/Swimming_pool", "_new"],
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", ""],
["http://i30.tinypic.com/531q3n.jpg", "", ""],
["http://i31.tinypic.com/119w28m.jpg", "", ""]
],
autoplay: true,
persist: false,
pause: 2500, //pause between slides (milliseconds)
fadeduration: 500, //transition duration (milliseconds)
oninit:function(){ //event that fires when gallery has initialized/ ready to run
var d = document.getElementById(this.wrapperid).getElementsByTagName('div'), c, i;
for (i = d.length - 1; i > -1; --i)
if (d[i].className == 'navpanellayer'){
c = d[i];
break;
}
document.getElementById('simpc1').appendChild(c.parentNode.removeChild(c));
},
onslide:function(curslide, i){ //event that fires after each slide is shown
//curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
//i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)
}
})
</script>
Then in the body, for example:
Code:
<div id="simplegallery1"></div>
<br>
<div id="simpc1"></div>
Here's a demo, where I used slightly different style and markup for the external controls, so as to place them just beneath the gallery and match their background color to the gallery border to get an integrated look to it:
http://home.comcast.net/~jscheuer1/side/simple_gal/
Bookmarks