1/** 2Botones.class.js 3 4Descripcion: 5 sirve para cambiar entre imágenes, prirncipalmente 6 para hacer botones que cambien con el mouseover. 7 Próximamente podría quedar obsoleto, por lo que la documentación es básica 8 9Dependencias: 10 Ninguna 11 12Versión: 13 2.0.0 - 11/11/2009 - CVI - Primera versión orientada a objetos. 14 Basada en la versión 1.1 de botones.js 15**/ 16 17var Botones = { 18 19 /** 20 * Funcion que se encarga de cambiar una imagen por otra. 21 * Ver documentacion para ver como se usa. 22 * @param imag Objeto DOM que representa a la imagen 23 */ 24 toogle: function (imag) { 25 if(typeof imag === 'undefined') { 26 return; 27 } 28 var thesrc = imag.src; 29 var ind = thesrc.lastIndexOf('.'); 30 var before = thesrc.substr(0, ind-2); 31 var state = thesrc.substr(ind-2, 2); 32 var after = thesrc.substr(ind, thesrc.length - ind); 33 var newstate = ''; 34 if(state == 'on') { 35 newstate = 'of'; 36 } else if(state == 'of') { 37 newstate = 'on'; 38 } else { 39 return; 40 } 41 imag.src = before + newstate + after; 42 return; 43 }, 44 45 /** 46 * Funcion que se encarga de agregar nuevos eventos a una determinada imagen 47 * @param idImag Id de la imagen 48 */ 49 addEvent: function(idImag) { 50 if(typeof idImag === 'undefined') { 51 return; 52 } 53 if(document.getElementById && document.getElementById(idImag)) { 54 var theImag = document.getElementById(idImag); 55 theImag.onmouseover = function() { 56 Botones.toogle(this); 57 }; 58 theImag.onmouseout = function() { 59 Botones.toogle(this); 60 }; 61 } 62 } 63 64};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.