/    Sign up×
Community /Pin to ProfileBookmark

hi there!
I am new at javascript and I need big help if u can help me?
Probably my problem for u is piece of cake…but form me….arg 😑 so, read what i have to ask

for example i have index page…and on that page i have enter site button…and i want to get code that will get user resolution, and depending of resolution when i click button ‘enter site’ open same pop up page but different size.hope that u understand my problem….sorry for my bad grammar

thanx in advance

to post a comment
JavaScript

6 Comments(s) ↴

Copy linkTweet thisAlerts:
@KorMay 31.2004 β€”Β Hm... Isn't it easyier to build a unique "liquid" designed popup and adjust it's dimention according to the resolution? Otherwise you must build as many separat pages as possible resolutions are (and ther ARE quite some...:-) )
Copy linkTweet thisAlerts:
@airJXMay 31.2004 β€”Β Is this what you mean?

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Open pop-up page</title>

<script language="JavaScript" type="text/JavaScript">

<i> </i> function showWindow() {
<i> </i> if (window.screen.availWidth &amp;&amp; window.screen.availHeight) {
<i> </i> settings = "toolbar=no,location=yes,directories=no," +
<i> </i> "status=yes,menubar=no,scrollbars=no," +
<i> </i> "resizable=no,width=" + window.screen.availWidth +
<i> </i> ",height=" + window.screen.availHeight
<i> </i> newWindow = window.open("http://www.airJX.com","",settings);
<i> </i> }
<i> </i> }

&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;a href="#" onclick="showWindow()"&gt;Show Window&lt;/a&gt;

&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@circulationauthorMay 31.2004 β€”Β tnx for that solution ?

i think i must be more specific..i cant rearrange your code cause i'm totaly new in scripting

so i will tell you again my problem

ok..button that opened same page fixed size depending of resolution...so size of the page will be different at different resolution...i need that cause i made page at resolution 800x600 and i have scroll bar, at 1024x768 and higher resolution a i do not need that scrool bar...so i just wanna make bigger hight at resolution that are higher then 800x600...and if it is possible that that pop up be centered on page no matter what resolution u are using

thank u very much
Copy linkTweet thisAlerts:
@airJXJun 01.2004 β€”Β How about this?

&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

&lt;head&gt;
&lt;title&gt;Open popup page&lt;/title&gt;

&lt;script language="JavaScript" type="text/JavaScript"&gt;

<i> </i> function showWindow() {
<i> </i> if (window.screen.availWidth &amp;&amp; window.screen.availHeight) {
<i> </i> if (windows.screen.availWidth &lt; 1024) {
<i> </i> settings = "toolbar=no,location=yes,directories=no," +
<i> </i> "status=yes,menubar=no,scrollbars=[b]yes[/b]," +
<i> </i> "resizable=no,width=800,height=600";
<i> </i> newWindow = window.open("800.html","",settings);
<i> </i> } else {
<i> </i> settings = "toolbar=no,location=yes,directories=no," +
<i> </i> "status=yes,menubar=no,scrollbars=[b]no[/b]," +
<i> </i> "resizable=no,width=1024,height=768";
<i> </i> newWindow = window.open("1024.html","",settings);
<i> </i> }
<i> </i> }
<i> </i> }

&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;a href="#" onclick="showWindow()"&gt;Show Window&lt;/a&gt;

&lt;/body&gt;
&lt;/html&gt;
This will open the page 800.html in a window of 800 by 600 if the width of the screen is smaller than 1024 and the page 1024.html in a window of 1024 by 768 if the width of the screen is 1024 or larger.
Copy linkTweet thisAlerts:
@circulationauthorJun 01.2004 β€”Β thank u

it is very good solution, but i have some error

is it my mistake?
Copy linkTweet thisAlerts:
@circulationauthorJun 08.2004 β€”Β Does anyone have some good solution? Help, I need somebody ..as Beatles sang ?

thank u people?
Γ—

Success!

Help @circulation 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.19,
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,
)...