Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    10
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Resize image's thumbnail

    Hi, I need to resize the image's thumbnail, how can I do it?
    this my php code, which part of the code that I need to change or add?
    I want to resize the thumbnail to 100x67

    PHP Code:
    ?php
    for($i=1;$i<10;$i++)
     {
     if(!empty($foto[$i]))
      {
         if($i==1)

        

        

    {

        

        

    $foto_first=$foto[$i];

        

        

    }

        

    echo "<img border=0 width=0px height=2px src='conf/i/".$foto[$i]."'>";

        

    $dataku.="'".$foto[$i]."': { thumbnail: 'thumb/".$foto[$i]."'},";
      }
      else
      {

        

    $i--;

        

    break;
      }   
     }

    $dataku=substr($dataku,0,-1); 
    ?>

        

    <link rel="stylesheet" href="css/slideshow.css">

        


        

    <script src="js/mootools-1.3.1-core.js"></script>

        

    <script src="js/mootools-1.3.1.1-more.js"></script>

        

    <script src="js/slideshow.js"></script>

        

    <script src="js/slideshow.flash.js"></script>

        

    <script>

        

        

    window.addEvent('domready', function(){

        

        

        

    var data = { <?php echo $dataku;?>};

    new Slideshow.Flash('flash', data, { color: ['tomato'],duration: 1500, delay: 10000, height: 400, hu: 'conf/i/', width: 500});

        

        

        

        


        

        

    });

        

    </script>

        


        

    <div style="padding-bottom:350px;padding-right:100px">

        

    <div id="flash" class="slideshow">

        

        

    <img src="conf/i/<?php echo $foto_first?>" alt="1" height=100px><br>

        

    </div>

        

    </div>

  • #2
    Regular Coder
    Join Date
    Jan 2012
    Posts
    134
    Thanks
    0
    Thanked 32 Times in 32 Posts
    To change the size of an image in HTML, add the following attributes:

    Code:
    width="100px" height="67px"
    For example:

    Code:
    <img src="image.jpg" width="100px" height="67px"/>

  • Users who have thanked KuriosJon for this post:

    grandgefx (01-22-2012)

  • #3
    New Coder
    Join Date
    Jan 2012
    Posts
    10
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by KuriosJon View Post
    To change the size of an image in HTML, add the following attributes:

    Code:
    width="100px" height="67px"
    For example:

    Code:
    <img src="image.jpg" width="100px" height="67px"/>
    Hi thank you for the quick response,

    but what I really want to know is how to set the thumbnail pic's size
    I think I need to add something on this part of code
    PHP Code:
    echo "<img border=0 width=0px height=2px src='conf/i/".$foto[$i]."'>";

        

    $dataku.="'".$foto[$i]."': { thumbnail: 'thumb/".$foto[$i]."'},";
      }
      else
      { 

    you see the thumbnail pics have different size,
    i want to set all the thumbnail pics to 100 x 67
    Last edited by grandgefx; 01-22-2012 at 03:20 PM.


  •  

    Posting Permissions

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