42 users online (2 members and 40 guests)  


  Results 1 to 2 of 2

Related

  1. help with 3d flash gallery    Forum: Graphics Forum
    Replies: 0
  2. Image Gallery help..    Forum: Javascript Forum
    Replies: 1
  3. Best image gallery software?    Forum: Graphics Forum
    Replies: 1
  1. #1
    ofi's Avatar
    New User

    Status
    Offline
    Join Date
    Apr 2004
    Location
    Iceland
    Posts
    3

    Image gallery help

    Hi
    I need small help with this, check this link http://www.koddinn.com/mynd.php

    this is image galley, what i am trying to put up is, when i put mouse over the image, it will fade out to larger size, when i take mouse off the image, it will go back to the smaller.

    Hope you know what i mean, i dont speak wery good English.

    Here is the code i am using now.
    Code:
    <head>
           <title>Myndasafn!</title>
    </head>
    <body>
    <?
    $curfile = basename( $_SERVER['PHP_SELF'] );
    ?>
    <style>
    <!--
    body {
        font-family: Verdana;
        font-size: 11px;
        color: #000000;
    }
    table {
        font-family: Verdana;
        font-size: 12px;
        color: #000000;
    }
    a {
        text-decoration: none;
        color: darkred;
    }
    -->
    </style>
    <?
    if( !$popup )
    {
    ?>
    <script language=JavaScript>
    <!--
    function mynd(album,mynd)
    {
        window.open('mynda.php?sAlbum='+album+'&sPic='+mynd,'myndasafn','status=0,menu=0,toolbar=0,scrollbarsl=no,width=600,height=400');
        return false;
    }
    -->
    </script>
    <?
    }
    # Vinsamlegast stilltu etta allt eftir num rfum...
    
    # Notast vi albm ea ekki; 1 = j. 0 = nei.
    # 0 =  setur myndir  myndamppuna.
    # 1 =  setur albmin  myndamppuna (albm = mppur me myndum )
    $album = 1;
    
    # Hvort  viljir a myndin birtist  popup ea ekki; 1 = j. 0 = nei.
    $popup = 1;
    
    # Mappan sem vi geymum allar myndirnar/albmin .
    $mappa = 'myndir';
    
    # Hve margar myndir  rinni.
    $cols = 3;
    
    # Hve margar rair anga til a kemur n blasa.
    $rows = 3;
    
    # Ekki stilla neitt fyrir nean etta.
    
    if( $_GET['sAlbum'] )
        $heild = $mappa . '/' . $_GET['sAlbum'];
    else
        $heild = $mappa;
    
    if( $_GET['sPic'] )
    {
        if( $popup )
        {
    ?>
    <script>
    var isNav4, isIE4;
    if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
    isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
    isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
    }
    function fitWindowSize() {
    if (isNav4) {
    window.innerWidth = document.layers[0].document.images[0].width;
    window.innerHeight = document.layers[0].document.images[0].height;
    }
    if (isIE4) {
    window.resizeTo(500, 500);
    width = 500 - (document.body.clientWidth -  document.images[0].width);
    height = 500 - (document.body.clientHeight -  document.images[0].height);
    window.resizeTo(width, height);
       }
       }
    </script>
    <body onload="fitWindowSize()" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
    <?
        }
        else
            echo '<div align="center"><a href="' . $curfile . '?sAlbum=' . $_GET['sAlbum'] . '&sPage=' . $_GET['sPage'] . '">Aftur  albm</a></div><br><br>';
    
    ?>
    <div align="center"><img src="<? if( $popup ) echo $_GET['sAlbum'] . '/' . $_GET['sPic']; else echo $heild . '/' . $_GET['sPic']; ?>" border="0" style="border: 1px solid #000000" <? if( $popup ) { ?>onClick="window.close();window.opener.focus()" style="cursor: hand" title="Loka glugga"<? } ?>></div>
    <?
    }
    elseif( !$_GET['sAlbum'] && $album )
    {
    ?>
        <b>Veldu albm:</b><br><br>
    <?
        $handle = opendir( $mappa );
        while( false !== ( $skra = readdir( $handle ) ) )
        {
            if( $skra != '.' && $skra != '..' && is_dir( $mappa . '/' . $skra ) )
            {
    ?>
                <a href="<?=$curfile?>?sAlbum=<?=$skra?>"><?=str_replace( '_', ' ', $skra )?></a><br>
    <?
            }
        }
    }
    else
    {
        $perpage = $cols * $rows;
    
        if( !$_GET['sPage'] )
            $sPage = 1;
        else
            $sPage = $_GET['sPage'];
    
        $begin = ( $sPage * $perpage ) - $perpage;
        $end = ( $sPage * $perpage ) - 1;
    
        $handle = opendir( $heild );
        while( false !== ( $pic = readdir( $handle ) ) )
        {
            if( $pic != '.' && $pic != '..' && !is_dir( $heild . '/' . $pic ) )
                $arrPics[] = $pic;
        }
    
        $num = count( $arrPics );
    
        $pages = ceil( $num / $perpage );
        if( $pages != 1 )
        {
    ?>
            <div align="center"><font size="3">
    <?
            for( $i = 1; $i <= $pages; $i++ )
            {
    
                if( $sPage == $i )
                    echo $i;
                else
                {
    ?>
                    <a href="<?=$curfile?>?sAlbum=<?=$_GET['sAlbum']?>&sPage=<?=$i?>" style="text-decoration: none"><u><?=$i?></u></a>
    <?
                }
    
                if( $i != $pages )
                    echo ' ';
            }
    ?>
            </font></div>
    <?
        }
    ?>
        <table border="0" cellspacing="3" align="center">
        <tr>
        <td colspan="<?=$cols?>">&nbsp;</td>
        </tr>
        <tr>
    <?
        $i = 0;
        for( $j = $begin; $j <= $end; $j++ )
        {
    ?>
            <td align="center" valign="top">
    <?
            if( $arrPics[$j] )
            {
    ?>
                <a href="<? if( !$popup ) echo $curfile . '?sAlbum=' . $_GET['sAlbum'] . '&sPage=' . $sPage . '&sPic=' . $arrPics[$j]; else echo '#' ?>"<? if( $popup ) { ?> onClick="return mynd('<?=$heild?>','<?=$arrPics[$j]?>')"<? } ?>><img src="<?=$heild?>/<?=$arrPics[$j]?>" height="100" border="0" style="border: 1px solid #000000"></a><br><?=$arrPics[$j]?>
    <?
            }
    ?>
            </td>
    <?
    
            $i++;
    
            if( $i == $cols )
            {
    ?>
                </tr><tr>
    <?
                $i = 0;
            }
        }
    ?>
        </tr>
        </table>
    <?
    }
    
    if( !$_GET['sPic'] )
    {
    ?>

  2. #2
    veigh's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2004
    Posts
    1
    Hi,.. I am not sure if you solved your problem. If not, I could help using flash for the effect.


    Veighlyn



Tags for this Thread