A
asnowfall
<img src=...Onlick = "if (!(this.temp>=640)) { this.temp=640; } if
(this.width>=640) { xyz=this.width; this.width=this.temp;
this.temp=xyz; }">
Inline script....
I got the above code from internet and it is used to change the width
of the IMG element. This not only "changes" the width but also
"refreshes" the page so that I can see the change in width.
Function script...
I moved above inline script to a JS file and it is as follows. Now,
'width' of the IMG element seem to change but display does not get
refreshed; and if I add a window.alert( ); then I see screen
refreshing
function Show()
{
iImageWidth = 640;
if(document.getElementById) //gecko(NN6) + IE 5+
{
var obj = document.getElementById("IndividualImageID");
if (!(obj.LastWidth>=iImageWidth))
{
'window.alert( 'obj.LastWidth = ' + obj.LastWidth ); //Uncommenting
this line would
//
display image with new width
obj.LastWidth=iImageWidth;
}
if (obj.width>=iImageWidth)
{
'window.alert( 'obj.LastWidth1 = ' + obj.LastWidth ); //Uncommenting
this line would
//
display image with new width
xyz=obj.width;
obj.width=obj.LastWidth;
obj.LastWidth=xyz;
}
}
}
Please let me know how can I make this script refresh.
Thanks
Ramesh
(this.width>=640) { xyz=this.width; this.width=this.temp;
this.temp=xyz; }">
Inline script....
I got the above code from internet and it is used to change the width
of the IMG element. This not only "changes" the width but also
"refreshes" the page so that I can see the change in width.
Function script...
I moved above inline script to a JS file and it is as follows. Now,
'width' of the IMG element seem to change but display does not get
refreshed; and if I add a window.alert( ); then I see screen
refreshing
function Show()
{
iImageWidth = 640;
if(document.getElementById) //gecko(NN6) + IE 5+
{
var obj = document.getElementById("IndividualImageID");
if (!(obj.LastWidth>=iImageWidth))
{
'window.alert( 'obj.LastWidth = ' + obj.LastWidth ); //Uncommenting
this line would
//
display image with new width
obj.LastWidth=iImageWidth;
}
if (obj.width>=iImageWidth)
{
'window.alert( 'obj.LastWidth1 = ' + obj.LastWidth ); //Uncommenting
this line would
//
display image with new width
xyz=obj.width;
obj.width=obj.LastWidth;
obj.LastWidth=xyz;
}
}
}
Please let me know how can I make this script refresh.
Thanks
Ramesh