/    Sign up×
Community /Pin to ProfileBookmark

Help Required! PLEASE!!!!

Hi every1!
I am a newbie in JavaScript and thus need ur help on the following issue:

i have written this code in my index.htm file:

[COLOR=red]

<script language = “JavaScript”>

function openw() {
w = screen.width;
h = screen.height;

if (w >= 1280 && h >= 1024) {
finalw = 800
finalh = 400
}
else if (w >= 1024 && h >= 768) {
finalw = 600
finalh = 400
}
else if (w >= 800 && h >= 600) {
finalw = 400
finalh = 200
}
else {
finalw = 200
finalh = 100
}
window.open (‘main.htm’,”,’width=’+finalw+’,height=’+finalh);
}

function makeNewWindow() {

var n_win;
var windowProps;

windowFeatures = “top=0, left=0, resizable=no” +”,width=” + (window.innerWidth = screen.width)+”,height=” + (window.innerHeight = screen.height);
newWindow = window.open (“main2.htm”,”,windowFeatures)
newWindow.focus();

}

[/COLOR]
these 2 fucnctions r working correctly… but the only problem is that a pc doesn’t use the full resolution while opening a browser window… thus if on 1280×1024 a popup window appears having the same width and height… some of the window isn’t visible! u can visit [url]www.themightythor.com[/url] to see what i exactly want. when u enter this site… the window resizes to the resolution u r currently using and keeps itself on top! i have tried reading its script but its way too advanced for me….

please guyz… this thing is killing me!!! please help me with this!!! i have already tried using window.innerHeight and width but it didn’t work!

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@JonaMar 22.2003 — Just put this in your main page:

newwin.innerWidth = screen.width;

newwin.innerHeight = screen.height;

newwin.screenX = 0;

newwin.screenY = 0;
Copy linkTweet thisAlerts:
@shardauthorMar 22.2003 — well thankyou brother for ur kind help and time... ur code did work but only for width... yes the width is now equal to the used resolution but the height is the same as before and thus some of it contents are not fully visible!

please tell me what to do now!?!??!
Copy linkTweet thisAlerts:
@JonaMar 22.2003 — It should work for both. Double-check your code for typos.
Copy linkTweet thisAlerts:
@shardauthorMar 22.2003 — no typos for sure sir! checked it again and again... infact now i realized that it isn't workin for neither one... it looked as if it was workin' for the height! what does the function newwin do? can't we use it in the function nw() in the page that triggers main.htm/main2.htm pages????
Copy linkTweet thisAlerts:
@JonaMar 22.2003 — Oh, duh, change newWin to newWindow
Copy linkTweet thisAlerts:
@shardauthorMar 22.2003 — lol! i think i did mention in my thread that i was a newbie...! anywayz changing newWin to newWindow doesn't work neither! i am using win2000 pro with IE 6.0 and a monitor resolution of 1280x1024.... is that a problem?
×

Success!

Help @shard 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.24,
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,
)...