473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Resizing window and image buttons question

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.

Oct 11 '06 #1
5 3255
GTi
GTi wrote:
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.
Anyone ?

Oct 14 '06 #2
GTi
Maybe this is the wrong group?

GTi wrote:
GTi wrote:
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.

Anyone ?
Oct 21 '06 #3
TC
(top-posted for consistency)

Q2 asks about CSS, so that would be offtopic here.

As for Q1, you show some script, but you don't say whether it works or
not. People often won't bother to guess, they'll just move on to the
next question.

Here's a tip for how to ask your question more effectively:
http://tc2.atspace.com/0012-UsingUsenet.htm#PostBody

Please note that you should bottom-post (not top-post) in this group.
http://en.wikipedia.org/wiki/Top-posting

HTH,
TC (MVP MSAccess)
http://tc2.atspace.com
GTi wrote:
Maybe this is the wrong group?

GTi wrote:
GTi wrote:
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.
Anyone ?
Oct 21 '06 #4
TC said the following on 10/21/2006 1:06 PM:
(top-posted for consistency)
There is nothing "consistent" about top posting in clj. The preferred
posting style here, as stated in the FAQ somewhere, is to interleave the
replies.

<snip>
Please note that you should bottom-post (not top-post) in this group.
http://en.wikipedia.org/wiki/Top-posting
Then why did you top post?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 21 '06 #5
TC

Randy Webb wrote:
blah blah blah blah

I'm sure the OP will benefit from your useful additional comments.

TC (MVP MSAccess)
http://tc2.atspace.com

Oct 22 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ivan Voras | last post by:
I hava a hierarhical sizer layout in which there's a panel in the upper part of a window with some buttons, and another panel with wxVListBox that's meant to occupy all the remaining space in the...
10
by: riki | last post by:
Hi, i have a big problem...i'm using one jscript for resizing of all of my pics in popUp...in main html i'm having many little pics and clicking on them they open in popUp and resize to larger...
9
by: Bryan R. Meyer | last post by:
Hello Everyone, The problem of browser resizing has become an issue for me. While redesigning my webpage, I set the left and right margins to be auto so that my content would be centered. ...
6
by: Robert J. O'Hara | last post by:
I'm one of those people who practices what some consider "dull" and others consider "elegantly conservative" page design. I appreciate good traditional typography and standards-compliant liquid...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
0
by: Sam Barham | last post by:
I have a ListView control, for which I have overwritten the WndProc method to gain access to the WM_PAINT message and generate my own OnPaint and OnPaintBackground messages, in order to colour the...
10
by: David W. Simmonds | last post by:
I have a DataList control that has an Image control in the ItemTemplate. I would like to resize the image that goes into that control. I have a series of jpg files that are full size, full...
6
by: JDeats | last post by:
I have a WinForms based application written for the .NET Framework 2.0 and in this application I need to be able to be able to take some action in code when the user finishes resizing the form. ...
10
by: mishrarajesh44 | last post by:
hii all, I am facing a problem currently.. i have a script for image uploading and resizing.. the image uploading takes place properly for every size images.. but, the resizing works for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.