Results 1 to 4 of 4

Thread: open in iframe

  1. #1
    Join Date
    Jun 2006
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking open in iframe

    hey all. i have a javascript and php script and i have just been at it way to long today that my brain is starting to fart.
    any who i want my javascript to open up in a iframe i have made instead of in the blank window it was built to open up in.
    here is the script. (clients)
    PHP Code:
     <tr>
        <td width="400" height="384" align="center" valign="middle"><iframe name="gallery" scrolling="no" align="middle" height="350" width="350"></iframe></td>
      <td width="350" align="center" valign="middle"> <script type="text/javascript">
    <!--this function needs to be change to display in iframe if image clicked-->
    function view(url)
    {
        window.open(url, 'pic', '');
        return false;
    }

        </script>

          <table cellpadding="2" class="gallery">
      <tr>
      <?php

    $path 
    'styles/images';
    $path_thumbs 'styles/thumbs';
    $extensions = array('jpg''jpeg''bmp''gif''png');

    ##################################################  #############


    $dir opendir($path_thumbs);
    $images = array();
    $used = array();


    while ((
    $file readdir($dir)) !== false)
    {
        
    $ext strtolower(substr(strrchr($file'.'), 1));
        
        if (
    in_array($ext$extensions))
        {
            
    $images[] = $file;
        }
    }

    function 
    get_rand()
    {
        global 
    $used$images;
        
        
    $rand rand(0sizeof($images) - 1);
        
        if (
    in_array($rand$used))
        {
            
    $rand get_rand();
        }
        
        return 
    $rand;
    }

    for (
    $i 1$i <= 9$i++)
    {
        
    $rnd get_rand();
        
    $used[] = $rnd;
        
        echo 
    '<td><a href="'$path .'/'$images[$rnd] .'" onclick="return view(this.href);">
    //this part needs to be changed to onclick="something"
                <img src="'
    $path_thumbs .'/'$images[$rnd] .'" align="middle" border="0" />
            </a></td>' 
    ."\n";
        
        if (
    $i == OR $i == 6)
        {
            echo 
    '</td><tr>';
        }
    }

    ?>
      </tr>
          </table></td>
      </tr>
    thank for the help in advance

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    function view(url)
    {
        window.open(url, 'pic', '');
        window.frames['framename'].location.href = url;
        return false;
    }
    Remove the bit in red, add the bit in blue, and change the bit in green to the name of your frame. And if you're colourblind, gods help you.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jun 2006
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks tway,
    stud qualitys on that now i can pack up for the day much help. much help.
    http://www.ejlcustomgolf.com/virtualTour.php
    if you had interest
    any thoughts on how i can better do things would be great

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Specify a white background-color, and validate it!
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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