Okay, ho messo il javascript nella cartella stile, adesso vado in un tema, e cosa faccio su overall_header.html devo incollare il codice che è scritto nel file javascript?
----
Ho aperto overall_header.html col block note ho inserito il codice di resize img:
Codice PHP:
var _img_max_width = 665; //change this if you want another size
var _img_mouseover_title = 'Clic here to view image in full size.'; //Change here for the message to display when the mouse is over the resized image
//||Don't touch anything after here if you don't know what are you doing.
function addLoadEvent(func){
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
}else{
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(function () {
if (document.getElementsByTagName) {
var imgs = document.getElementsByTagName('img');
for (i = 0; i < imgs.length; i++) {
var im = imgs[i];
if (im.getAttribute('rel') != 'resize') continue;
var src = im.src;
var width = im.width;
var height = im.height;
if (width > _img_max_width) {
im.style.width = _img_max_width + 'px';
im.onclick = function() {
var pop=window.open(this.src, 'imgbig', 'height=768,width=1024,resizable=1,scrollbars=1');
//Changed from var pop = window.open(this.src, 'imgbig', 'width='+width+',height='+height+', scrollbars=0,resizable=0,toolbar=0');
//Removed pop.resizeBy(width-pop.document.body.clientWidth,height-pop.document.body.clientHeight);
pop.focus();
}
im.style.cursor = document.all ? 'hand' : 'pointer' ;
im.style.border = '1px dotted #000';
im.style.margin = '2px';
im.title = _img_mouseover_title;
}
}
}
});
lo messo alla fine di overall_header.html, poi ho messo il javascript nella cartella styles ma non nel singolo tema, e non funziona le foto sono sempre enormi : p