02 enero 2008

25 errores comunes en los desarrollos Web

Pues checando el mail me encontré con el boletín de webtaller, que para ser sincero tengo poco haciéndole caso, y en verdad me pregunto porque no lo hice antes, ya que tiene buenas notas, ahora les traigo una de las que me gusto. el titulo lo dice todo.



1. Error 1: Peso en la página
2. Error 2: DTD inexistentes
3. Error 3: Páginas sin el idioma especificado
4. Error 4: Títulos de página molestos y enigmáticos
5. Error 5: Sin imágenes navegar una página es imposible
6. Error 6: URL matemáticas, casi imposibles de entender y recordar
7. Error 7: Código prehistórico reemplazable con CSS
8. Error 8: Olvidarse de la semántica, los documentos son una pila de información sin clasificar…
9. Error 9: Sin estilos la página no se entiende, ni tiene significado…
10. Error 10: Documentos Web que son enemigos de la impresora
11. Error 11: Ventanas emergentes, inútiles, sin sentido y no muy accesibles.
12. Error 12: Instale Flash, o de lo contrario no podrá navegar el sitio Web
13. Error 13: Javascript supera todas las tecnologías de lenguajes, HTML, CSS, PHP, Javascript es la hostia…
14. Error 14: HTML no es un lenguaje de modelaje de páginas
15. Error 15: HTML comentado, es igual a más peso en la página
16. Error 16: Utilizar hojas de estilo en línea o embebidas en los documentos
17. Error 17: Javascript no modularizado
18. Error 18: Elementos Meta inservibles…
19. Error 19: Mapa Web del sitio
20. Error 20: Buscador ciego… buscador inútil
21. Error 21: La Web no es la televisión
22. Error 22: Frames no, si us plau.
23. Error 23: Formularios inaccesibles
24. Error 24: Tipografías mal aplicadas
25. Error 25: Archivos multimedia, PDF, etc.



Bueno aver que les parecen y ojo en su proximo trabajo ;)

Seguir leyendo »

Tetris con jQuery

Para poner el famoso juego de tetris utilizando jQuery y tetris.js


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>
<title>Tetris with jQuery</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="tetris.js"></script>
<link rel="stylesheet" type="text/css" href="tetris.css"/>
</head>

<body>

<h1>Tetris with jQuery</h1>

<div id="tetris">

<div id="grid">
<table>
<tr><td id="a1"></td><td id="a2"></td><td id="a3"></td><td id="a4"></td><td id="a5"></td><td id="a6"></td><td id="a7"></td><td id="a8"></td><td id="a9"></td><td id="a10"></td></tr>
<tr><td id="b1"></td><td id="b2"></td><td id="b3"></td><td id="b4"></td><td id="b5"></td><td id="b6"></td><td id="b7"></td><td id="b8"></td><td id="b9"></td><td id="b10"></td></tr>
<tr><td id="c1"></td><td id="c2"></td><td id="c3"></td><td id="c4"></td><td id="c5"></td><td id="c6"></td><td id="c7"></td><td id="c8"></td><td id="c9"></td><td id="c10"></td></tr>
<tr><td id="d1"></td><td id="d2"></td><td id="d3"></td><td id="d4"></td><td id="d5"></td><td id="d6"></td><td id="d7"></td><td id="d8"></td><td id="d9"></td><td id="d10"></td></tr>
<tr><td id="e1"></td><td id="e2"></td><td id="e3"></td><td id="e4"></td><td id="e5"></td><td id="e6"></td><td id="e7"></td><td id="e8"></td><td id="e9"></td><td id="e10"></td></tr>
<tr><td id="f1"></td><td id="f2"></td><td id="f3"></td><td id="f4"></td><td id="f5"></td><td id="f6"></td><td id="f7"></td><td id="f8"></td><td id="f9"></td><td id="f10"></td></tr>
<tr><td id="g1"></td><td id="g2"></td><td id="g3"></td><td id="g4"></td><td id="g5"></td><td id="g6"></td><td id="g7"></td><td id="g8"></td><td id="g9"></td><td id="g10"></td></tr>
<tr><td id="h1"></td><td id="h2"></td><td id="h3"></td><td id="h4"></td><td id="h5"></td><td id="h6"></td><td id="h7"></td><td id="h8"></td><td id="h9"></td><td id="h10"></td></tr>
<tr><td id="i1"></td><td id="i2"></td><td id="i3"></td><td id="i4"></td><td id="i5"></td><td id="i6"></td><td id="i7"></td><td id="i8"></td><td id="i9"></td><td id="i10"></td></tr>
<tr><td id="j1"></td><td id="j2"></td><td id="j3"></td><td id="j4"></td><td id="j5"></td><td id="j6"></td><td id="j7"></td><td id="j8"></td><td id="j9"></td><td id="j10"></td></tr>
<tr><td id="k1"></td><td id="k2"></td><td id="k3"></td><td id="k4"></td><td id="k5"></td><td id="k6"></td><td id="k7"></td><td id="k8"></td><td id="k9"></td><td id="k10"></td></tr>
<tr><td id="l1"></td><td id="l2"></td><td id="l3"></td><td id="l4"></td><td id="l5"></td><td id="l6"></td><td id="l7"></td><td id="l8"></td><td id="l9"></td><td id="l10"></td></tr>

<tr><td id="m1"></td><td id="m2"></td><td id="m3"></td><td id="m4"></td><td id="m5"></td><td id="m6"></td><td id="m7"></td><td id="m8"></td><td id="m9"></td><td id="m10"></td></tr>
<tr><td id="n1"></td><td id="n2"></td><td id="n3"></td><td id="n4"></td><td id="n5"></td><td id="n6"></td><td id="n7"></td><td id="n8"></td><td id="n9"></td><td id="n10"></td></tr>
<tr><td id="o1"></td><td id="o2"></td><td id="o3"></td><td id="o4"></td><td id="o5"></td><td id="o6"></td><td id="o7"></td><td id="o8"></td><td id="o9"></td><td id="o10"></td></tr>
<tr><td id="p1"></td><td id="p2"></td><td id="p3"></td><td id="p4"></td><td id="p5"></td><td id="p6"></td><td id="p7"></td><td id="p8"></td><td id="p9"></td><td id="p10"></td></tr>
<tr><td id="q1"></td><td id="q2"></td><td id="q3"></td><td id="q4"></td><td id="q5"></td><td id="q6"></td><td id="q7"></td><td id="q8"></td><td id="q9"></td><td id="q10"></td></tr>
<tr><td id="r1"></td><td id="r2"></td><td id="r3"></td><td id="r4"></td><td id="r5"></td><td id="r6"></td><td id="r7"></td><td id="r8"></td><td id="r9"></td><td id="r10"></td></tr>
</table>
</div>

<div id="next">
<table>
<tr><td id="x00"></td><td id="x10"></td><td id="x20"></td><td id="x30"></td></tr>
<tr><td id="x01"></td><td id="x11"></td><td id="x21"></td><td id="x31"></td></tr>
<tr><td id="x02"></td><td id="x12"></td><td id="x22"></td><td id="x32"></td></tr>
<tr><td id="x03"></td><td id="x13"></td><td id="x23"></td><td id="x33"></td></tr>
</table>
</div>

<div id="stats">
<div>Level: <span id="level">1</span></div>
<div>Lines: <span id="lines">0</span></div>
<div>Score: <span id="score">0</span></div>
</div>

<div id="cmd">
<input id="start" type="button" value="start"/><br/>
<input id="stop" type="button" value="stop" disabled="disabled"/>
</div>

<div id="info">
<div>Left: J</div>
<div>Right: L</div>
<div>Rotate: I</div>
<div>Down: K</div>
</div>

</div>

<div id="overlay"></div>

<a id="src" href="tetris.js">Source code</a>

</body>

</html>


Tetris.js
/*
* Tetris with jQuery - 2006/06/25
* see: http://en.wikipedia.org/wiki/Category:Tetris
* http://en.wikipedia.org/wiki/Tetris_Worlds
* be careful: http://en.wikipedia.org/wiki/Tetris_effect
* Copyright (c) 2006 Franck Marcia
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/

var tetris = {

// Shape colors
colors: ['#eaeaea','#ff6600','#ffff00','#0000ff',
'#cc00ff','#00ff00','#66ccff','#ff0000'],

// Starting line for each shape
startAt: [0, -1, -1, -1, 0, -1, -1, 0],

// Points per number of lines
points: [0, 40, 100, 300, 1200],

// Combination of each shape
shapes: [
// none
[],
// I
[[[0,0,0,0],[1,1,1,1],[0,0,0,0],[0,0,0,0]],
[[0,1,0,0],[0,1,0,0],[0,1,0,0],[0,1,0,0]]],
// T
[[[0,0,0,0],[1,1,1,0],[0,1,0,0],[0,0,0,0]],
[[0,1,0,0],[1,1,0,0],[0,1,0,0],[0,0,0,0]],
[[0,1,0,0],[1,1,1,0],[0,0,0,0],[0,0,0,0]],
[[0,1,0,0],[0,1,1,0],[0,1,0,0],[0,0,0,0]]],
// L
[[[0,0,0,0],[1,1,1,0],[1,0,0,0],[0,0,0,0]],
[[1,1,0,0],[0,1,0,0],[0,1,0,0],[0,0,0,0]],
[[0,0,1,0],[1,1,1,0],[0,0,0,0],[0,0,0,0]],
[[0,1,0,0],[0,1,0,0],[0,1,1,0],[0,0,0,0]]],
// J
[[[1,0,0,0],[1,1,1,0],[0,0,0,0],[0,0,0,0]],
[[0,1,1,0],[0,1,0,0],[0,1,0,0],[0,0,0,0]],
[[0,0,0,0],[1,1,1,0],[0,0,1,0],[0,0,0,0]],
[[0,1,0,0],[0,1,0,0],[1,1,0,0],[0,0,0,0]]],
// Z
[[[0,0,0,0],[1,1,0,0],[0,1,1,0],[0,0,0,0]],
[[0,0,1,0],[0,1,1,0],[0,1,0,0],[0,0,0,0]]],
// S
[[[0,0,0,0],[0,1,1,0],[1,1,0,0],[0,0,0,0]],
[[0,1,0,0],[0,1,1,0],[0,0,1,0],[0,0,0,0]]],
// O
[[[0,1,1,0],[0,1,1,0],[0,0,0,0],[0,0,0,0]]]],

// Pre-load elements of the grid
init: function() {
var i, j, k;
tetris.cells = [];
for (i = -3; i < 18; ++i) {
tetris.cells[i] = [];
for (j = 1; j < 11; ++j) {
k = String.fromCharCode(i + 97);
tetris.cells[i][j] = $(['#', k, j].join(''));
}
}
tetris.bound = $.browser == 'msie' ? '#tetris' : window;
},

// Initialize to start the game
start: function() {
// Stats
tetris.level = 0;
tetris.lines = 0;
tetris.score = 0;
// Array which contains data of the grid
tetris.grid = [
[1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,1],
[1,1,1,1,1,1,1,1,1,1,1,1]];
$('#grid td').css('backgroundColor', tetris.colors[0]);
$('#start').unclick(tetris.start).val('pause').click(tetris.pause);
$('#stop').set('disabled', false);
$(tetris.bound).keypress(tetris.key);
tetris.next = tetris.newShape();
tetris.shift();
tetris.duration = 600;
tetris.refresh();
tetris.timer = window.setInterval(tetris.moveDown, tetris.duration);
},

// Define the action to be fired depending on key entry
key: function(e) {
switch(e.charCode || e.keyCode) {
case 74: case 106: tetris.moveLeft(); break; // J
case 76: case 108: tetris.moveRight(); break; // L
case 75: case 107: tetris.moveDown(); break; // K
case 73: case 105: tetris.rotate(); break; // I
}
return false;
},

// Generate an random shape
newShape: function() {
var r = 1 + Math.random() * 7;
return parseInt(r > 7 ? 7 : r, 10);
},

// Define then draw the next shape
setNext: function() {
var i, j, s, c, d, n = tetris.colors[0];
tetris.next = tetris.newShape();
s = tetris.shapes[tetris.next][0];
c = tetris.colors[tetris.next];
for (i = 0; i < 4; ++i) {
for (j = 0; j < 4; ++j) {
d = s[i][j] ? c : n;
$(['#x', j, i].join('')).css('backgroundColor', d);
}
}
},

// The next shape becomes the current one; reset coordinates
shift: function() {
tetris.cur = tetris.next;
tetris.x = tetris.x0 = 4;
tetris.y = tetris.startAt[tetris.cur];
tetris.y0 = tetris.y - 2;
tetris.r = tetris.r0 = 0;
tetris.curShape = tetris.shapes[tetris.cur];
if (tetris.canGo(0, tetris.x, tetris.y)) {
tetris.setNext();
return true;
}
return false;
},

// Pause the game
pause: function() {
$(tetris.bound).unkeypress(tetris.key);
window.clearInterval(tetris.timer);
tetris.timer = null;
$('#start').unclick(tetris.pause).val('resume').click(tetris.resume);
},

// Resume the game
resume: function() {
$(tetris.bound).keypress(tetris.key);
tetris.timer = window.setInterval(tetris.moveDown, tetris.duration);
$('#start').unclick(tetris.resume).val('pause').click(tetris.pause);
},

// Stop the game
gameOver: function() {
var i, j;
// Manage buttons
if (tetris.timer) {
$(tetris.bound).unkeypress(tetris.key);
window.clearInterval(tetris.timer);
tetris.timer = null;
$('#start').unclick(tetris.pause).val('start').click(tetris.start);
} else {
$('#start').unclick(tetris.resume).val('start').click(tetris.start);
}
$('#stop').set('disabled', true);
// Draw everything in white
for (i = 0; i < 18; ++i) {
for (j = 1; j < 11; ++j) {
if (tetris.grid[i][j]) {
tetris.cells[i][j].css('backgroundColor', '#ffffff');
}
}
}
tetris.draw(tetris.r0, tetris.x0, tetris.y0, '#ffffff');
},

// Check overlays
canGo: function(r, x, y) {
var i, j;
for (i = 0; i < 4; ++i) {
for (j = 0; j < 4; ++j) {
if (tetris.curShape[r][j][i] && tetris.grid[y + j] &&
tetris.grid[y + j][x + i]) {
return false;
}
}
}
return true;
},

// Move the current shape to the left
moveLeft: function() {
if (tetris.canGo(tetris.r, tetris.x - 1, tetris.y)) {
--tetris.x;
tetris.refresh();
}
},

// Move the current shape to the right
moveRight: function() {
if (tetris.canGo(tetris.r, tetris.x + 1, tetris.y)) {
++tetris.x;
tetris.refresh();
}
},

// Rotate the current shape
rotate: function() {
var r = tetris.r == tetris.curShape.length - 1 ? 0 : tetris.r + 1;
if (tetris.canGo(r, tetris.x, tetris.y)) {
tetris.r0 = tetris.r;
tetris.r = r;
tetris.refresh();
}
},

// Move down the current shape
moveDown: function() {
if (tetris.canGo(tetris.r, tetris.x, tetris.y + 1)) {
++tetris.y;
tetris.refresh();
} else {
tetris.touchDown();
}
},

// The current shape touches down
touchDown: function() {
var i, j, k, r, f;
// mark the grid
for (i = 0; i < 4; ++i) {
for (j = 0; j < 4; ++j) {
if (tetris.curShape[tetris.r][j][i] &&
tetris.grid[tetris.y + j]) {
tetris.grid[tetris.y + j][tetris.x + i] = tetris.cur;
}
}
}
// search complete lines
f = 0;
for (i = 17, k = 17; i > -1 && f < 4; --i, --k) {
if (tetris.grid[i].join('').indexOf('0') == -1) {
// Complete lines become white
for (j = 1; j < 11; ++j) {
tetris.cells[k][j].css('backgroundColor', '#ffffff');
}
++f;
for (j = i; j > 0; --j) {
tetris.grid[j] = tetris.grid[j - 1].concat();
}
++i;
}
}
// animate
if (f) {
window.clearInterval(tetris.timer);
tetris.timer = window.setTimeout(function(){tetris.after(f);}, 100);
}
// try to continue
if (tetris.shift()) {
tetris.refresh();
} else {
tetris.gameOver();
}
},

// Finish the touchdown process
after: function(f) {
var i, j, l = (tetris.level < 20 ? tetris.level : 20) * 25;
// stats
tetris.lines += f;
if (tetris.lines % 10 === 0) {
tetris.level = tetris.lines / 10;
}
window.clearTimeout(tetris.timer);
tetris.timer = window.setInterval(tetris.moveDown, tetris.duration - l);
tetris.score += (tetris.level + 1) * tetris.points[f];
// redraw the grid
for (i = 0; i < 18; ++i) {
for (j = 1; j < 11; ++j) {
tetris.cells[i][j].css('backgroundColor',
tetris.colors[tetris.grid[i][j]]);
}
}
tetris.refresh();
},

// Draw the current shape
draw: function(r, x, y, c) {
var i, j;
for (i = 0; i < 4; ++i) {
for (j = 0; j < 4; ++j) {
if (tetris.curShape[r][j][i]) {
tetris.cells[y + j][x + i].css('backgroundColor', c);
}
}
}
},

// Refresh the grid
refresh: function() {
// remove from the old position
tetris.draw(tetris.r0, tetris.x0, tetris.y0, tetris.colors[0]);
// draw to the next one
tetris.draw(tetris.r, tetris.x, tetris.y, tetris.colors[tetris.cur]);
// change stats
$('#level').html(tetris.level + 1);
$('#lines').html(tetris.lines);
$('#score').html(tetris.score);
// reset coordinates
tetris.x0 = tetris.x;
tetris.y0 = tetris.y;
tetris.r0 = tetris.r;
}

};

// Everything starts here
$(window).load(function() {
tetris.init();
$('#grid table, #next table').css('backgroundColor', tetris.colors[0]);
$('#start').click(tetris.start);
$('#stop').click(tetris.gameOver);
});


Descargar jQuery

Seguir leyendo »

Creación de controles en tiempo de ejecución

Pues estoy haciendo mis inicios en programacion para PDA's y Smartphones, con ayuda de Visual Studio 2005, siendo mas especifico con C#, bueno aquí un código para crear una Label en tiempo de ejecución:



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using Systme.Windows.Forms;

namespace NewControls
{
public partial class Form1 : form

{

Public Form1()

InitializeComponent();
CrearControl();
}

private void CreateControl()
{
//Creamos el objeto control ( Etiqueta )
Label lblControl = new Label();

//Establecemos propiedades para el control
lblControl.Name = "MiControlEtiqueta";
lblControl.Bounds = new Rectangle(7, 14, 70, 30);

//Añadimos el control etiqueta al formulario
this.Controls.Add(lblControl);
}


Seguir leyendo »

Mis días sin cable....

Este último mes a sido muy tormentoso en cuanto a televesión se refiera, para empezar vale decir que no tengo un TV en mi cuarto, pero una hermana salio 6 mese a otra ciudad y me apodere de su tele... pero noooo!!! nos cortaron el cable y mi señora madre no lo a pagado... y me e dado cuenta de algo, de la mierda que nos dan a ver a los nosotros los mexicanos, porque si no son novelas no se que más pasan.
Yo soy un fiel seguidor de canales como NATGEO, Discovery Chanel y The History Chanel, así que ya se han de imaginar mi desesperación a ver que en la TV solo ponen mierda, y dicen que los mexicanos somo los mas bajos en lo que a educación escolar se refiere... y como no? si son niños solo ven estupideces como dragon ball y cosas asi, si son niñas las pendejadas de Lola las chavitas un poco más grandes con su rebelde... que jajaja como me cago de risa.. como es sabido uno de los integrantes del grupo se declaro homosexual y hasta se caso o algo así, jaja y en la "serie" lo ponen de todo un "pinga loca" jajajaja (no es nada en contra de los homosexuales ni nada por el estilo, pero es que eso es absurdo no crees?).
Bueno... espero que algún día en nuestra señal de TV abierta programen cosas interesantes... pero la verdad no creo... maldita sea ya quiero cable de nuevo... :S

Seguir leyendo »

Paginación Virtual

Este script es de gran utilidad en cuanto a la velocidad, ya que todo se actualiza en la misma página, sin necesidad de mandar llamar al servidor, bueno aquí les dejo el código y una pequeña captura.



El siguiente codigo entre las etiquetas Head y /Head
<script type="text/javascript" src="virtualpaginate.js">

</script>

<style type="text/css">

/*Sample CSS used for the Virtual Pagination Demos. Modify/ remove as desired*/

.virtualpage, .virtualpage2, .virtualpage3{
/*hide the broken up pieces of contents until script is called. Remove if desired*/
display: none;
}

.paginationstyle{ /*Style for demo pagination divs*/
width: 250px;
text-align: center;
padding: 2px 0;
margin: 10px 0;
}

.paginationstyle select{ /*Style for demo pagination divs' select menu*/
border: 1px solid navy;
margin: 0 15px;
}

.paginationstyle a{ /*Pagination links style*/
padding: 0 5px;
text-decoration: none;
border: 1px solid black;
color: navy;
background-color: white;
}

.paginationstyle a:hover, .paginationstyle a.selected{
color: #000;
background-color: #FEE496;
}

.paginationstyle a.imglinks{ /*Pagination Image links style (class="imglinks") */
border: 0;
padding: 0;
}

.paginationstyle a.imglinks img{
vertical-align: bottom;
border: 0;
}

.paginationstyle a.imglinks a:hover{
background: none;
}

.paginationstyle .flatview a:hover, .paginationstyle .flatview a.selected{ /*Pagination div "flatview" links style*/
color: #000;
background-color: yellow;
}

</style>

Descargar virtualpaginate.js


El siguiente codigo entre las etiquetas Body y /Body:
<!--###### Virtual Pagination Demo 1 ######### -->
<h3>Demo 1:</h3>

<div style="width: 300px; height: 230px;">

<div class="virtualpage">
<img src="http://img184.imageshack.us/img184/1159/castleyi6.gif" />
</div>

<div class="virtualpage">
<img src="http://img201.imageshack.us/img201/7907/streetkz4.gif" />
</div>

<div class="virtualpage">
<img src="http://img201.imageshack.us/img201/8538/weedjh8.gif" />
</div>

<div class="virtualpage">
<img src="http://img201.imageshack.us/img201/6923/countryxb6.gif" />
</div>

</div>

<!-- Pagination DIV for Demo 1 -->
<div id="gallerypaginate" class="paginationstyle">
<a href="#" rel="previous">Prev</a> <span class="flatview"></span> <a href="#" rel="next">Next</a>
</div>

<!-- Initialize Demo 1 -->
<script type="text/javascript">
var gallery=new virtualpaginate("virtualpage", 1)
gallery.buildpagination("gallerypaginate")
</script>



<!--###### Virtual Pagination Demo 2 ######### -->
<h3>Demo 2:</h3>

<div style="width: 450px; height: 200px; border: 1px dashed gray; padding: 10px; background-color: #EEFFAA">

<p class="virtualpage2">
<b><a href="#">RSS Display Boxes</a></b> <span class="credits">Credits: Dynamic Drive</span><br>
Tme to get your RSS on! Using Ajax, this script makes it easy to display RSS feeds from other sites inside DIV containers, by communicating with a versatile PHP RSS parser called "Simplepie". Each RSS box can be independently tailored, from the RSS feed to fetch, how many items to show (and whether to paginate them), to what portions of each entry (just the "title", or "title" plus "description" etc) to display.
</p>

<p class="virtualpage2">
<b><a href="#">Interstitial Content Box</a></b> <span class="credits">Credits: Dynamic Drive</span><br>
An interstitial is a container that appears over an entire webpage intermittingly to display content in an eye catching way. This is a Interstitial Box script that uses <b>Ajax</b> to fetch and display the contents of external pages on your server as an interstitial.
</p>

<p class="virtualpage2">
<b><a href="#">Omni Slide Menu</a></b> <span class="credits">Credits: John Scheuer</span><br>
Omni Slide Menu is an super versatile slideout menu that reacts to the mouse hovering over and out of it. It can be positioned to the left, top, or right edge of the browser window, supports static positioning, plus multiple instances of the same menu on a page and more. Very cool.
</p>

<p class="virtualpage2">
<b><a href="#">Custom Cursor Script II (Crosshair mouse cursor)</a></b> <span class="credits">Credits: Webtoolkit.info</span><br>
This script adds a custom cursor to your webpage using an interchangeable image. The result is a custom mouse cursor that can be modified in anyway your graphic skills take you. Elegant and non intrusive effect!
</p>

<p class="virtualpage2">
<b><a href="#">Drop Down Tab Menu</a></b> <span class="credits">Credits: Dynamic Drive</span><br>
This is a lean CSS tab menu that supports a 2nd level drop down menu for any of its tabs. It supports subtle yet helpful features such as the ability to set a default selected tab, hide any element on the page (ie: a form field) when the menu drops down etc.
</p>

<p class="virtualpage2">
<b><a href="#">Featured Content Slider</a></b> <span class="credits">Credits: Dynamic Drive</span><br>
Featured Content Slider makes a slideshow out of arbitrary content on your page, so users can manually select a content to see or have them rotated automatically. Pagination links let the user quickly pick a content to show. Each content is simply normal HTML wrapped in DIV tags for effortless integration.
</p>

</div>

<!-- Pagination DIV for Demo 2 -->
<div id="scriptspaginate" class="paginationstyle" style="width: 400px">
<a href="#" rel="first">F</a> <a href="#" rel="previous">Prev</a> <span class="paginateinfo" style="margin: 0 30px; font-weight: bold"></span> <a href="#" rel="next">Next</a> <a href="#" rel="last">L</a>
</div>

<!-- Initialize Demo 2 -->
<script type="text/javascript">
var newscripts=new virtualpaginate("virtualpage2", 1, "p") //Let script know you're using "p" tags as separator (instead of default "div")
newscripts.buildpagination("scriptspaginate")
</script>



<!--###### Virtual Pagination Demo 3 ######### -->
<h3>Demo 3:</h3>

<!-- Pagination DIV for Demo 3 -->
<div id="listingpaginate" class="paginationstyle">
<a href="#" rel="previous" class="imglinks"><img src="http://img293.imageshack.us/img293/8643/roundleftig4.gif" /></a> <select></select> <a href="#" rel="next" class="imglinks"><img src="http://img183.imageshack.us/img183/3816/roundrightat5.gif" /></a>
</div>

<div style="width: 450px; border: 1px dashed gray; padding: 10px;">

<p class="virtualpage3">
<b><a href="#">RSS Display Boxes</a></b> <span class="credits">Credits: Dynamic Drive</span><br>
Tme to get your RSS on! Using Ajax, this script makes it easy to display RSS feeds from other sites inside DIV containers, by communicating with a versatile PHP RSS parser called "Simplepie". Each RSS box can be independently tailored, from the RSS feed to fetch, how many items to show (and whether to paginate them), to what portions of each entry (just the "title", or "title" plus "description" etc) to display.
</p>

<p class="virtualpage3">
<b><a href="#">Interstitial Content Box</a></b> <span class="credits">Credits: Dynamic Drive</span><br>
An interstitial is a container that appears over an entire webpage intermittingly to display content in an eye catching way. This is a Interstitial Box script that uses <b>Ajax</b> to fetch and display the contents of external pages on your server as an interstitial.
</p>

<p class="virtualpage3">
<b><a href="#">Omni Slide Menu</a></b> <span class="credits">Credits: John Scheuer</span><br>
Omni Slide Menu is an super versatile slideout menu that reacts to the mouse hovering over and out of it. It can be positioned to the left, top, or right edge of the browser window, supports static positioning, plus multiple instances of the same menu on a page and more. Very cool.
</p>

<p class="virtualpage3">
<b><a href="#">Custom Cursor Script II (Crosshair mouse cursor)</a></b> <span class="credits">Credits: Webtoolkit.info</span><br>
This script adds a custom cursor to your webpage using an interchangeable image. The result is a custom mouse cursor that can be modified in anyway your graphic skills take you. Elegant and non intrusive effect!
</p>

<p class="virtualpage3">
<b><a href="#">Drop Down Tab Menu</a></b> <span class="credits">Credits: Dynamic Drive</span><br>
This is a lean CSS tab menu that supports a 2nd level drop down menu for any of its tabs. It supports subtle yet helpful features such as the ability to set a default selected tab, hide any element on the page (ie: a form field) when the menu drops down etc.
</p>

<p class="virtualpage3">
<b><a href="#">Featured Content Slider</a></b> <span class="credits">Credits: Dynamic Drive</span><br>
Featured Content Slider makes a slideshow out of arbitrary content on your page, so users can manually select a content to see or have them rotated automatically. Pagination links let the user quickly pick a content to show. Each content is simply normal HTML wrapped in DIV tags for effortless integration.
</p>

</div>

<!-- Initialize Demo 3 -->
<script type="text/javascript">
var whatsnew=new virtualpaginate("virtualpage3", 2, "p") //Let script know you're using "p" tags as separator (instead of default "div")
whatsnew.buildpagination("listingpaginate")
</script>


<hr style="margin-top: 35px; color: red" />

<!--###### Virtual Pagination Demo 4 ######### -->
<h3>Demo 4 (shows "flatview" pagination interface with custom text defined):</h3>

<div style="width: 300px; height: 230px;">

<div class="virtualpage4">
<img src="http://img184.imageshack.us/img184/1159/castleyi6.gif" />
</div>

<div class="virtualpage4">
<img src="http://img201.imageshack.us/img201/7907/streetkz4.gif" />
</div>

<div class="virtualpage4">
<img src="http://img201.imageshack.us/img201/8538/weedjh8.gif" />
</div>

<div class="virtualpage4">
<img src="http://img201.imageshack.us/img201/6923/countryxb6.gif" />
</div>

</div>

<!-- Pagination DIV for Demo 4 -->
<div id="galleryalt" class="paginationstyle" style="width: 300px; text-align: left">
<a href="#" rel="previous"><</a> <span class="flatview"></span> <a href="#" rel="next">></a>
</div>

<!-- Initialize Demo 4 -->
<script type="text/javascript">
var gallery=new virtualpaginate("virtualpage4", 1)
gallery.buildpagination("galleryalt", ["castle", "park", "harvest", "country"])
</script>



<!--###### Virtual Pagination Demo 5 ######### -->
<h3>Demo 5 (shows "SELECT" pagination interface with custom text defined):</h3>

<div style="width: 300px; height: 230px;">

<div class="virtualpage5">
<img src="http://img184.imageshack.us/img184/1159/castleyi6.gif" />
</div>

<div class="virtualpage5">
<img src="http://img201.imageshack.us/img201/7907/streetkz4.gif" />
</div>

<div class="virtualpage5">
<img src="http://img201.imageshack.us/img201/8538/weedjh8.gif" />
</div>

<div class="virtualpage5">
<img src="http://img201.imageshack.us/img201/6923/countryxb6.gif" />
</div>

</div>

<!-- Pagination DIV for Demo 5 -->
<div id="galleryselect" class="paginationstyle">
<a href="#" rel="previous">Prev</a> <select style="width: 120px"></select> <a href="#" rel="next">Next</a>
</div>

<!-- Initialize Demo 5 -->
<script type="text/javascript">
var gallery=new virtualpaginate("virtualpage5", 1)
gallery.buildpagination("galleryselect", ["castle", "park", "harvest", "country"])
</script>

Seguir leyendo »

01 enero 2008

Colapsar un div

Vamos a ver un script que suele ser de mucha utilidad cuando tenemos un contenido que no precisamente queremos que sea visto al momento de cargar la página, y para que se visible el usuario dará click sobre el titulo y la noticia, articulo o lo que sea aparecerá por debajo y para ocultar da click de nuevo y ocultar, el código es el siguiente:


El siguiente codigo entre Head y /Head
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script type="text/javascript" src="animatedcollapse.js">

</script>


Descargar animatedcollapse.js



El siguiente dentro de las etiquetas Body y /Body, donde queramos que aparesca el script
<p><b>Example 1:</b></p>

<a href="javascript:collapse1.slidedown()">Slide Down</a> || <a href="javascript:collapse1.slideup()">Slide Up</a>
<div id="dog" style="width: 300px; height: 110px; background-color: #99E0FB;">

<!--Your DIV content as follows -->
<h3>Content inside DIV!</h3>
<h4>Note: CSS height attribute defined</h4>

</div>

<script type="text/javascript">

//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
var collapse1=new animatedcollapse("dog", 1000, false)

</script>



<p><b>Example 2:</b></p>

<a href="javascript:collapse2.slideit()">Show/ Hide DIV</a>
<div id="cat" style="width: 300px; background-color: #99E0FB;">

<!--Your DIV content as follows. Note to add CSS padding or margins, do it inside a DIV within the Collapsible DIV -->
<div style="padding: 0 5px">
<h3>Content inside DIV!</h3>
<h3>Content inside DIV!</h3>
<h4>Note: No CSS height attribute defined. Persistence enabled.</h4>
</div>

</div>

<script type="text/javascript">

//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
var collapse2=new animatedcollapse("cat", 800, true)

</script>




<p><b>Example 3:</b></p>

<a href="javascript:collapse3.slidedown()">Slide Down</a> || <a href="javascript:collapse3.slideup()">Slide Up</a>
<div id="fish" style="width: 300px; height: 150px; background-color: #99E0FB;">

<!--Your DIV content as follows -->
<h3>Content inside DIV!</h3>
<h4>Note: DIV set not to collapse initially. Note that if "enablepersist" is enabled, cookie value overrides this setting.</h4>

</div>

<script type="text/javascript">

//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
var collapse3=new animatedcollapse("fish", 1000, false, "block")

</script>

Seguir leyendo »