/    Sign up×
Community /Pin to ProfileBookmark

How to find out monitor resolutions

Hi Friends,

While checking the conditions, if the monitor resolution is 1024×768 it should call one functions, and if monitor resolution will change to 1280×1024
shuuld call some other function,

Can any please suggest me it is possible?

thanks and regards,
Sandhya

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Kostas_ZotosOct 05.2007 — Hi, I don't know if you mean something like this:

[CODE]<script language="JavaScript">

var Width=screen.width;
var Height=screen.height;

if (Width==1024 && Height==768) {
function1Name(); // call a function1
}

if (Width==1280 && Height==1024) {
function2Name(Arg1, Arg2, Arg3); // call another function 2 (and pass it 3 arguments)
}

</script>[/CODE]


Kostas
Copy linkTweet thisAlerts:
@felgallOct 05.2007 — You would use

<i>
</i>window.open(pagetoload,'_blank','width='+screen.width+',height='+screen.height);


to open a new window full screen.

That is about the only use for screen resolution as for everything else you only get to work with the space in the window and all the screen resolution tells you about that is that it will definitely be smaller.

If you are using the size for anything other than opening a new window you need to test the browser window size and how you do that is different for different browsers. See http://javascript.about.com/library/blscreen2.htm for a copy of the functions that I wrote that can retrieve that info by using whichever method the browser supports.
Copy linkTweet thisAlerts:
@LeeUOct 05.2007 — Here's one that you could easily adapt to what you need.
×

Success!

Help @Sandhya_Rani_G spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...