G
GTi
Q1)
I have searched around after a cross browser JavaScript that can resize
my popup window with a specified width and height.
I want to set the width and height of the browsers document content.
Does anyone have a nice script that actual set the inner width/height
so it is equal on browsers ( IE/FF )
function SetWindowSize(winWidth,winHeight)
{
var d=document;
if (typeof window.innerWidth!='undefined')
{
window.innerWidth = winWidth;
window.innerHeight = winHeight;
}
else
{
if (d.documentElement && typeof
d.documentElement.clientWidth!='undefined' &&
d.documentElement.clientWidth!=0)
{
d.documentElement.clientWidth = winWidth;
d.documentElement.clientHeight = winHeight;
}
else
{
if (d.body && typeof d.body.clientWidth!='undefined')
{
d.body.clientWidth = winWidth;
d.body.clientHeight = winHeight;
}
}
}
}
Q2)
How can I specify the partion of a image I want to display using CSS.
Say I have one image with the size 100x200.
But I only want to display the 0,0,100,100 (x,y,w,h)
I want to use this to create image buttons with different images on
normal, hover, mouse down, disabled etc. with only one image.
With this I want to pre-cache the images since it is already loaded the
first time.
I have searched around after a cross browser JavaScript that can resize
my popup window with a specified width and height.
I want to set the width and height of the browsers document content.
Does anyone have a nice script that actual set the inner width/height
so it is equal on browsers ( IE/FF )
function SetWindowSize(winWidth,winHeight)
{
var d=document;
if (typeof window.innerWidth!='undefined')
{
window.innerWidth = winWidth;
window.innerHeight = winHeight;
}
else
{
if (d.documentElement && typeof
d.documentElement.clientWidth!='undefined' &&
d.documentElement.clientWidth!=0)
{
d.documentElement.clientWidth = winWidth;
d.documentElement.clientHeight = winHeight;
}
else
{
if (d.body && typeof d.body.clientWidth!='undefined')
{
d.body.clientWidth = winWidth;
d.body.clientHeight = winHeight;
}
}
}
}
Q2)
How can I specify the partion of a image I want to display using CSS.
Say I have one image with the size 100x200.
But I only want to display the 0,0,100,100 (x,y,w,h)
I want to use this to create image buttons with different images on
normal, hover, mouse down, disabled etc. with only one image.
With this I want to pre-cache the images since it is already loaded the
first time.