Jump to content

create a dropdown from a script thats done?


wmguk

Recommended Posts

I currently have this script which makes a clickable link on the page for next page etc etc, however I was wondering if i can make a dropdown of pages and this auto change the page?

 

<script type="text/javascript">
for (i=1; i<Math.ceil(galleryarray.length/totalslots)+1; i++)
document.write('<a id="navlink'+i+'" href="javascript:jumptopage('+i+')\">Page'+i+'</a> ')
document.getElementById("navlink1").className="current"
</script>

Not tested

<script type="text/javascript">

document.write('<select name="page" onchange="jumptopage(this.value);">');

for (i=1; i<Math.ceil(galleryarray.length/totalslots)+1; i++) {
    document.write('<option value="'+i+'">Page '+i+'</option>');
}

document.write('</select>');

</script>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.