if ($handle = opendir($path)) { $ret = ”; while (false !== ($file = readdir($handle))) { if($file!=”.” && $file!=”..”){ $ret = $ret . ‘<li> <a class=”thumb” href=”‘.$path.’/’.”$file\n”.’” title=”your image title”> <img src=”‘.$path.’/’.”$file\n”.’” alt=”‘.$titulo.’” /> </a> <div class=”caption”> ‘.$titulo.’ </div> </li>’; } } closedir($handle); return $ret; }
Archive for September, 2009
Crear un efecto realista Hover con jQuery
¿Te gustaría crear un efecto realista Hover con jQuery ? Añade un efecto hover a un conjunto de enlaces utilizando el efecto jQuery Animate. En pocas palabras, el JS añade el reflejo / sombra a cada <li>, a continuación, anima a la posición y la opacidad de estos elementos y los iconos de los links [...]
Función PHP para forzar la descarga de archivos
function force_download($file) { if ((isset($file))&&(file_exists($file))) { header(“Content-length: “.filesize($file)); header(‘Content-Type: application/octet-stream’); header(‘Content-Disposition: attachment; filename=”‘ . $file . ‘”‘); readfile(“$file”); } else { echo “No se ha seleccionado ningún fichero”; } }
Acceder a Google Weather en PHP
Interesante clase para acceder de un modo sencillo al servicio metereológico de Google.Ejemplo: <?php class GoogleWeatherAPI { private $city_code = ”; private $city = ”; private $domain = ‘www.google.com’; private $prefix_images = ”; private $current_conditions = array(); private $forecast_conditions = array(); private $is_found = true; /** * Class constructor * @param $city_code is the label [...]
CSS hack para safari y chrome
@media screen and (-webkit-min-device-pixel-ratio:0) { div { color: red; /* The text will appear red only in Safari and Google Chrome */ } }