HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media


Welcome to TinyPortal. Please login or sign up.

June 05, 2023, 07:04:33 AM

Login with username, password and session length
  • Total Members: 3,864
  • Latest: Joonoz
  • Total Posts: 194,365
  • Total Topics: 21,157
  • Online today: 106
  • Online ever: 3,540
  • (September 03, 2022, 01:38:54 AM)
Users Online
Users: 1
Guests: 46
Total: 47

[Request] Javascript help please

Started by nokonium, October 18, 2006, 01:48:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I am on hol this week and I've picked up on my smilie gallery project again. I've been fiddling with it all morning and I think that I've taken it as far as I can. I already had an html page and a php file that would add to the gallery anything added to the folder, what I'm now trying to do is use a form and javascript from my old site that puts the url into a box, when you mousedown on a smilie, so that it can be copied and pasted. The script works on individual smilies in a table.

I have stopped it loading a new page to display a single image, inserted the form and (I think) stopped the scripts fighting with each other. What I can't seem to get working is the newly inserted scripts, one to put the image url into the form and one to clear the form.

I've attached a screenshot of the page and the file code follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" lang="en" xml:lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Mr Black Cat's Gallery</title>

<style type="text/css">

.slideshow{ /*CSS for DIV containing each image*/
float: left;
margin-top: 25px;
margin-bottom: 25px;
margin-left: 45px;
margin-right: 45px;
width: 10px;
height: 10px;
font-size: 80%;
.slideshow img{ /*CSS for each image tag*/
border: 0;

#navlinks{ /*CSS for DIV containing the navigational links*/
align: center;
width: 625px;
margin-top: 10px;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 3px;
word-spacing: 5px;

#navlinks a{ /*CSS for each navigational link*/

font-size: 100%;

#navlinks a.current{ /*CSS for currently selected navigational link*/
background-color: #522994;
color: #CCCCFF;
background-image: url(../black-cat-background.gif);
background-color: #CCCCFF;
vertical-align: bottom;

font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000066;
align: center;
font-size: 24pt;
font-family: Arial, Helvetica, sans-serif;
color: #000066;
align: center;
font-size: 100%;


<body onload="isReady=true">

<table width="625">
<span class="h2">Angry Smilies</span></td></tr>

<script src="" type="text/javascript"></script>

<script type="text/javascript">

* PHP Photo Album script- ÂÃ,© Dynamic Drive DHTML code library (
* Visit for hundreds of DHTML scripts
* This notice must stay intact for legal use

var dimension="5x5" //Specify dimension of gallery (number of images shown), such as 4x2, 3x1 etc
var imagepath="" //Absolute path to image directory. Include trailing slash (/)
var href_target="" //Enter target attribute of links, if applicable

//Toggle popup link setting: popupsetting[0 or 1, "pop up window attributes" (if 1)]
var popupsetting=[0, "width=100px, height=100px, scrollbars, resizable"]

//Toggle image description: descriptionprefix[0 or 1, "Text to show" (if 1)]
var descriptionprefix=[0, "Angry "]

//Sort images by date? ("asc", "desc", or "")
//"desc" for example causes the newest images to show up first in the gallery
//"" disables this feature, so images are sorted by file name (default)
var gsortorder="asc"

//By default, each image hyperlinks to itself.
//However, if you wish them to link to larger versions of themselves
//Specify the directory in which the larger images are located
//The file names of these large images should mirror those of the original
//Enter a blank string ("") to disable this option
var targetlinkdir=""

/////No need to edit beyond here///////////////////

function sortbydate(a, b){ //Sort images function
if (gsortorder=="asc") //sort by file date: older to newer
return new Date(a[1])-new Date(b[1])
else if (gsortorder=="desc") //sort by file date: newer to older
return new Date(b[1])-new Date(a[1])

if (gsortorder=="asc" || gsortorder=="desc")

var totalslots=dimension.split("x")[0]*dimension.split("x")[1]

function buildimage(i){
var imagecompletepath=(targetlinkdir!="")? targetlinkdir+galleryarray[i][0] : imagepath+galleryarray[i][0]
var tempcontainer=''
tempcontainer+='<img src="'+imagepath+galleryarray[i][0]+'" title="'+galleryarray[i][0]+' ['+galleryarray[i][1]+']" onmousedown="showAddress(this.src)" />'
tempcontainer+='<br />'
tempcontainer+=(descriptionprefix[0]==1)? descriptionprefix[1]+(i+1) : ""
return tempcontainer

function jumptopage(p){
var startpoint=(p-1)*totalslots
var y=1;
for (i=0; i<totalslots; i++){
document.getElementById("slide"+i).innerHTML=(typeof galleryarray[startpoint+i]!="undefined")? buildimage(startpoint+i) : ""

var curimage=0
for (y=0; y<dimension.split("x")[1]; y++){
for (x=0; x<dimension.split("x")[0]; x++){
if (curimage<galleryarray.length)
document.write('<div id="slide'+curimage+'" class="slideshow"> '+buildimage(curimage)+'</div>')
document.write('<br style="clear: left" />')

function popuplinkfunc(imgsrc){
if (popupsetting[0]==1){
var popwin=open(imgsrc.href, "popwin", popupsetting[0])
return false
return true

<script type="text/javascript">
var isReady = false;

function showAddress(this.src){

  if (isReady){

    document.Which.Where.value = What;



    alert("This page is not fully loaded yet...\nPlease wait for the page to finish loading.");



function clearAddress(){

  if (isReady){

    document.Which.Where.value = '';


    alert("This page is not fully loaded yet...\nPlease wait for the page to finish loading.");


            <td colspan="3" height="10" valign="middle" align="center">
            <td align="center" valign="top" height="30" width="84"> <p><font face="Arial" size="1" color="#663300"><b>Image
            <td align="center" valign="top" height="30" width="360"> <form name="Which">
                <input type="text" size="60" name="Where" maxlength="80">
            <td align="center" valign="top" height="30" width="76"><b><font
face="Arial" size="1"> <a href="#" onclick="clearAddress()" class="js"> Clear</a></font></b></td>

<tr><td><!--Below HTML code refers to the navigational links for the gallery-->

<div id="navlinks">
<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+')\">Angry '+i+'</a> ')