Avatar billede allstar Nybegynder
20. marts 2002 - 19:47 Der er 5 kommentarer og
1 løsning

Har Nogen ICQ som gider at hjælpe mig med at få et billede

Har Nogen ICQ som gider at hjælpe mig med at få et billede til at poppe up i et nyt vindue når man trykker på det ?
Avatar billede allstar Nybegynder
20. marts 2002 - 19:48 #1
Mit Icq nummer er : 154261079
Avatar billede sukos Juniormester
20. marts 2002 - 19:49 #2
Kan du ikke bare vise noget kode?

Eller få vist noget kode i javascript-kategorien?
Avatar billede sukos Juniormester
20. marts 2002 - 19:49 #3
Eller lave en søgning på "popup"?????
Avatar billede rkhdk Nybegynder
20. marts 2002 - 19:51 #4
allstar => husk at lægge loggen her på eksperten.dk, du du ikke må give pointz til nogen unden at det ligger på eksperten.dk!
Avatar billede allstar Nybegynder
20. marts 2002 - 19:59 #5
<?
//----  Settings Start ---\\
// Image Information
$imageWidth=130;
$imageHeight=107;

// Table Layout
$rows=100;
$cols=4;

//Image path
$libery="billeder/dorautomatik/"; // remember to finish with /

// Settings Stop----------//

$viewNum=$cols*$rows;
if(!$firstImage){ // so it works if you just enter default.php and show the pictures without having to define the variables in the path
        $firstImage=1;
}
function getImages($firstImage){
    global $viewNum, $imageWidth, $imageHeight,$cols,$libery;  //insures that the function gets the variables
    $handle=opendir($libery); //opens directory
    while($file=readdir($handle)){ // reads the directory
        $extension=substr($file,-4); // gets the extension of the files
        if(($extension == ".jpg") || ($extension == ".gif") || ($extension == ".png") ){ // checks for image files
            $all[]=$file;  //adds positive results to the archive
        }
    }
    $colscounter=0; // variable that controls the tablebuilding system below
    $firstImage--; // variable that insures that the first image is being showed. Case: It looks best if the links begins with 1 but the array begins with 0
    if(isset($all)){  // if array is set build the table
        print "<table>";
        for($i=$firstImage; $i < $firstImage+$viewNum; $i++){
            if($all[$i]){ // checks for rinning dry of imges
                if($i==$firstImage + $colscounter*$cols){ // if true: new row
                    $colscounter++;
                    print "<tr>";
                } // add the image
                print "<td><a href=".$libery."".$all[$i]."><img src='".$libery."".$all[$i]."' border='1' width='$imageWidth' height='$imageHeight' alt='Klik for at forstørre'></a></td>";
            }
            else{ // stop if no more images
                break;
            }
        }
        print "</table><br>";
        $num=count($all);  //number of pictures in actual libery
        makeList($num); // function to make the links list
    }
    else{
        print "Der var desværre ingen billeder i dette bibliotek<br><br><a href='java script:history.back()'>Tilbage</a>";
    }
}
function makeList($num){
    global $libery, $firstImage, $viewNum; //insures that the function gets the variables
    $numLinks = $num / $viewNum; // finds the number og links to be maked
    for($a=0; $a < $numLinks;$a++){
            $start=$a*$viewNum+1;  //adds 1 because then the links begins with ex. number 1-10 and 11-20 instead of 0-10 and 10-20
            $finish=$a*$viewNum+$viewNum;
            if($finish>$num){ // insures that the final link returns the right amount of pictures instead of to much
                $finish=$num;
            }
        if(($firstImage >= $start) && ($firstImage < $a * $viewNum+$viewNum)){ // if true: makes no link because you already are on the page
            print "$start - $finish</a>&nbsp;&nbsp;";
        }
        else{ // makes the link
            print "<a href='index.php?side=billeder/dorautomatik?libery=$libery&firstImage=$start'>$start - $finish</a>&nbsp;&nbsp;";
        }
    }
}
?>
<div align="center">
<?
getImages($firstImage);
?>
Avatar billede allstar Nybegynder
20. marts 2002 - 21:08 #6
Tør øjnene og tag en cola - det er vores lille hemmelighed...
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester