Cytat
function addEvent( obj, type, fn ) {
if ( obj.attachEvent ) {
obj['e'+type+fn] = fn;
obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
obj.attachEvent( 'on'+type, obj[type+fn] );
} else
obj.addEventListener( type, fn, false );
}
function resizeImg( handle )
{
var orig_x = handle.width;
var orig_y = handle.height;
if( handle.width > 600 )
{
handle.width = 600;
addEvent( this, 'click', function() { window.open( handle.src, handle.src,"location=1,status=1,scrollbars=1,width=100,height=100" ); } );
handle.className = 'img_resized';
}
}
if ( obj.attachEvent ) {
obj['e'+type+fn] = fn;
obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
obj.attachEvent( 'on'+type, obj[type+fn] );
} else
obj.addEventListener( type, fn, false );
}
function resizeImg( handle )
{
var orig_x = handle.width;
var orig_y = handle.height;
if( handle.width > 600 )
{
handle.width = 600;
addEvent( this, 'click', function() { window.open( handle.src, handle.src,"location=1,status=1,scrollbars=1,width=100,height=100" ); } );
handle.className = 'img_resized';
}
}
mam taki kod, dziala a stosuje go tak
Cytat
onClick="resizeImg( this );"
po kliknieciu w obrazek, otwiera mi wszystkie ktore ulegly resizeowi
nie wazne gdzie klikne, i tak sie wszystkie otworza
