Property values ​​in a CSS div jQuery

This is a very basic tip, basically consists in knowing what the value of a CSS property, through jQuery.

For example:

#div{display: none}

To know the value of this div in jQuery, addresses the following code statement:


var value = $('#div').css('display');
if(value == 'none'){
/*What you do*/
}else{
/*What you do*/
}

Until next time.


Event click, Attr, Event.PreventDefault, images change work

First of all, I start to write in English from now on will be very personal things in Spanish, or who knows … but will include English language at my blog, for a test of how far my article.

This is a small image change work for a catalog of products from a customer in theadvertising agency where I work, something simple but very useful, to make an image gallery and clicking will change the main image .

$('a.thumb').click(function(event){
event.preventDefault();
var rel = $(this).attr('rel');
$('img').attr('src',rel);
});

I do not think i have to explain code jQuery, if is doubt comment on the article.

Well, i finish as usual…

Until next time.


Insert into mysql date_format

INSERT INTO tabla (fecha) VALUES (DATE_FORMAT(STR_TO_DATE('$variable_fecha', '%d-%m-%Y'), '%Y-%m-%d'))

Hasta la próxima.


Update Date_Format MySQL

UPDATE table SET field=DATE_FORMAT(STR_TO_DATE('01-01-2011', '%d-%m-%Y'), '%Y-%m-%d') WHERE field_set=id

Hasta la próxima.


Reordenar (Reorder) primary key auto_increment mysql

mysql_query("ALTER TABLE tabla DROP id");
mysql_query("ALTER TABLE tabla AUTO_INCREMENT = 1");
mysql_query("ALTER TABLE tabla ADD id bigint UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST");

Hasta la próxima.


Como vencer a Internet Explorer con Jquery

Increíble, recordé que tenia blog y por sobre todo que me gustaba escribir mis vivencias. Por este motivo es que mi vida últimamente se ha transformado en desarrollar sitio web, ahora último desarrollar aplicaciones de gestión, también proyecciones personales, familia, novia y finalmente la tesis. Aunque tengo que reconocer que había olvidado este blog por flojera, porque no estaba escribiendo nada, solo trabajando, pero transformare este pequeño antro de mala clase, en mi lugar de experiencias laborales y experiencias personales.

Read the rest of this entry »


Invitar a todos tus amigos de Facebook de una pagina

Porque para todo esta la solución del “flojo“, incluso para invitar a unirse tanto a una pagina o grupo de Facebook a todos tus contactos. El truco consiste netamente en una función javascript, que selecciona todas tus contactos y les sugiere una invitación a tu grupo o pagina en Facebook. Los pasos son los siguientes:

  • Ingresar a la pagina o grupo en Facebook.
  • Luego presionar debajo de tu logo o marca, la siguiente opción “Sugerir esta pagina a mis amigos“. Posteriormente aparecerá una ventana emergente, con todos tus contactos agregados en tu cuenta.
  • Luego vas a la barra de direcciones, y escribes el siguiente codigo:
javascript:elms=document.getElementById('friends').getElementsByTagName('li');for(var fid in elms){if(typeof elms[fid] === 'object'){fs.click(elms[fid]);}}
  • Luego presionas ENTER, y automáticamente dependiendo de la cantidad de contactos que tengas, se seleccionaran todos tus contactos.
  • Y finalmente presionar el botón “Enviar invitaciones“.

Hasta la próxima.