Find the answer to your Linux question:
Results 1 to 9 of 9
I want to write a script that displays a bunch of thumb nails or pics. thats the easy part. I also want the script to, when some one clicks on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314

    writeing a script that displays thumbnails


    I want to write a script that displays a bunch of thumb nails or pics.

    thats the easy part.

    I also want the script to, when some one clicks on a thumb nail, to open a small window with that picture enlarged in it.

    I can do the first part but how do you do the second.
    The computer made me do it!! Slackware and SUSE too Gig\'em WHOOOOP!!
    \"God put me on this earth to accomplish a certain amount of tasks, At the rate I\'m going I will never die.\" (I don\'t know)

  2. #2
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Use a "a onclick" function for every picture that you print out..then you can use the tuning options to make the bigger page as you want...pasting in a little sample of the options you can use.

    Code:
    toolbar=no,width=700,height=400,left=400,top=400,status=no,scrollbars=no,resize=no

    Regards
    Regards

    Andutt

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yeah, that's really the best approach, to use JavaScript to open image windows. The bad side is that it won't work in all browsers, of course. Not that many browsers come without JavaScript support today, but some disable it and stuff. You _could_ use a TARGET="_blank" on the links, but that won't look as good, since you can't control the actual size and appearance of the new window.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314
    Ok what about this you have a big picture that sits on top of the table of pics, and when you click on one of the pics in the table it becomes the big pic. coul i avoid java script if i did that
    The computer made me do it!! Slackware and SUSE too Gig\'em WHOOOOP!!
    \"God put me on this earth to accomplish a certain amount of tasks, At the rate I\'m going I will never die.\" (I don\'t know)

  6. #5
    Linux User
    Join Date
    Apr 2003
    Location
    TEXAS
    Posts
    314
    <table border="1">
    <?
    $pics = file("picture.dat");
    $row_number = array_splice($pics,0,1);
    $num = $row_number[0];
    $rows = array_chunk($pics,(int)$num);
    ?>

    <?
    foreach($rows as $row) {
    echo "<tr>";
    foreach($row as $pic) {
    echo "<td>";
    ?>
    <?
    echo "<a href=\"$pic\" target=\"body\">";
    echo "<img src=\"$pic\" width=\"50\" height=\"50\">";
    echo "</a>";
    echo "</td>";
    }
    echo "</tr>";
    }

    ?>

    </table>

    Here is what ive written.

    Simple and ugly it gets the job done now Ive never written javascript before how would i incorporate it into my program here.

    and if for just morbid curiosity you want to see it in action go here

    http://bignasty.resnet.tamu.edu/~adam/testing/pipes/

    and click on pics
    The computer made me do it!! Slackware and SUSE too Gig\'em WHOOOOP!!
    \"God put me on this earth to accomplish a certain amount of tasks, At the rate I\'m going I will never die.\" (I don\'t know)

  7. #6
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Thats the good thing with a onclick that you actually can descide how big that pictures should be, if toolbars should exist and so on...like this....

    Code:
    echo "<a onclick=\"window.open&#40;THE PATH TO YOU BIG PICTURE ', 'WindowTitle', 'toolbar=no,width=500,height=450,left=300,top=50,status=no,scrollbars=no,resize=no'&#41;\">img src=PATH TO YOU THUMBNAIL alt='Here you can write a descrition of the image'></a>";
    That will work fine!!..

    REgards
    Regards

    Andutt

  8. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    You don't need to put the onClick script in a <A> tag. You can skip the <A> tag compeletely and put the onClick script in the <IMG> tag instead.

  9. #8
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    And?? this works just fine as it is...
    Regards

    Andutt

  10. #9
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Yeah, but not trimming unnecessary tags just reminds me of MS frontpage and its likes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •