How do I find the current browser window width in pixels?

I'm writing a PHP script that will use the current browser
window width
and height, but I don't know how to find that. Is there some
way to
capture the width and height of the current window in pixels?
TIA

Thanks Micha, you certainly may ask why.
I posted a message some time ago in the appdev forum about
the Recordset
Paging server behavior being geared toward use with tables. I
was
frustrated because I wanted to do something with repeated
div's in a
liquid site. But the Recordset Paging s.b. locks the number
of records
per page to a fixed number. I'm trying to figure out how to
make the
records per page a variable that's determined by the window
width. I've
created a liquid site with a products page that contains both
text and
thumbnail product images. The text occupies 2/3 of the width
of the
window, and the div container that holds the floated div
thumbnails I
want to account for the other third. The thumbnail div's are
produced by
a WHILE statement and I want them to be paged based on the
number of
div's that will fit within a container that occupies a
percent of the
browser window width. Here's what I've got so:
$window_size_wide = ; // Current browser window width in px
$window_size_tall = ; // Current browser window height in px
$thumb_cont_wide = $window_size_wide * .3; // 30% of window
width incl.
padding in px
$thumb_cont_tall = $window_size_tall * .4; // 40% of window
height incl.
padding in px
$thumb_size_wide = 100; // thumbnail div width incl. margins
in px
$thumb_size_tall = 100; // thumbnail div height incl. margins
in px
$no_thumbs_wide =
ceil(($thumb_cont_wide/$thumb_size_wide)-1);
$no_thumbs_tall =
ceil(($thumb_cont_tall/$thumb_size_tall)-1);
$records_per_page = ($no_thumbs_wide * $no_thumbs_tall);
$offset = ($thispage - 1) * $records_per_page;
$total_pages = ceil($total_records/$records_per_page);
etc.
What I don't know is how to find the current window width or
height. I
would also like to know if the $thumb_cont_wide and the
$thumb_cont_tall
can be determined in some way based on the div size generated
through my
CSS. In other words, I don't want to declare the percent of
height and
width in this script, I want to declare it only in my CSS and
have it
determined by the browser window width and height. The only
element I
want to hard code is the size of the thumbnails as they will
always be
the same. It seems to me that something like this could be
done to make
recordset paging scalable to match a scalable web page.
So the question is, can I define a PHP variable based on a
Javascript
variable? If so, how? If not, how can I accomplish this? Is
this just
not possible?
Thanks for your help.

Similar Messages

  • Why is Firefox opening a separate browser window for each link instead of a new tab in the current browser window?

    Suddenly firefox has started opening a new, separate browser window for every link and thing I open. It used to just open a new tab in the current browser. I must have closed down 15 browsers when trying to get back to a previous web page - the back button doesn't work when each click leads to a new window opening! I went into options and my settings have not changed, they still say "open new tab" for links. This just started happening out of the blue today. What's up?

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • On my E5-571-53S1 how do I find the license key Windows 8.1 ?

    On my E5-571-53S1 how do I find the license key for my copy of Windows 8.1 ?

    your license key is on BIOS, you don't need it if you want to re-install windows since it will be read automatically. if you still want to know your key:http://www.nirsoft.net/utils/product_cd_key_viewer.html

  • How can I open the Wndows Browse window from forms..

    I am using forms 5.0 and at run time I want to open the
    MSWINDOWS "BROWSE" window.Can any body help me?.

    I found this example in a book, which is useful for retrieving an
    image file from a local drive and inserting it into a table.
    I hope you find this helpful.
    DECLARE
         v_dirname          VARCHAR2(255);
         v_filename          VARCHAR2(255);
    BEGIN
         v_dirname := 'C:\';
         v_filename := get_file_name(v_dirname, NULL,
              'Bitmap file (*.bmp)|*.bmp|'                    ||
              'JPEG file (*.jpg)|*.jpg|'                         );
         IF v_filename IS NOT NULL THEN
              read_image_file(v_filename, 'ANY', 'av_data_image.blob_data');
         END IF;
    END;

  • How do I find the current connections?

    I've noticed that the disk doesn't always spin down after using my media player (OSMC on a Raspberry Pi) to access my My Cloud, and I'd like to debug this. First, I need to see if there's a persistent connection by checking the connection status at the My Cloud command line.  Googling tells me that you use the "smbstatus" command for this -- and there's my first stumbling block. That command is not present because it's in the "samba" package, which I am surprised to find is not installed by default.  # apt-cache policy samba
    samba:
    Installed: (none)
    Candidate: 2:4.1.17+dfsg-2
    Version table:
    2:4.1.17+dfsg-2 0
    500 http://ftp.us.debian.org/debian/ jessie/main armhf Packages I could install the "samba" package with "apt-get install samba". Is that safe to do on the My Cloud? The My Cloud is all about providing samba shares and yet the "samba" package is not installed. I was wondering if it was not installed for a reason. Installing it won't trash the My Cloud's normal services? Or is there a better way to find the current connections -- one that doesn't need the "smbstatus" command?

    Hi and welcome to the WD community.
    I have not tried this, lets see if another user can share some tips and information on this matter.

  • How can I find the currently logined domain name on Windows??

    Dear,
    I've a program that query some user account information from A.D.
    But I don't want to hard code anything.
    I've read some previous post about using LDAP, and using DNS queries to found all LDAP server of A.D.
    But how can I get the A.D. domain name in Java?
    for example
    ldcp://_ldap._tcp.xxxx.yyyy
    I want to get "xxxx.yyyy" from the logined user account. It is possible in Java.

    You coud use the NTSystem class to derive the NetBIOS domain name, however without doing some gymnastics it isn't easy to derive the fully qualified domain name. import java.io.*;
    import com.sun.security.auth.module.NTSystem;
    class NTDomain {
         public static void main(String[] args) {
              NTSystem system = new NTSystem();
              String domain = system.getDomain();
              System.out.println("Domain: " + domain);
    }The only other alternatives could be to check the domain suffix of the user principal that was authenticated via Kerberos ....
    lc = new LoginContext(searchkrb5.class.getName(),new SampleCallbackHandler());
         lc.login();
         catch (LoginException le) {
              System.out.println("Logon failed: " + le);
              System.exit(-1);
         System.out.println("Authenticated via GSS-API");
            System.out.println("User: " + lc.getSubject().getPrincipals().toString); however I think that you still have to specifify the Kerberos realm in the apps configuration file.
    Another alternative could be to make assumptions about the machines hostname, however one day an assumption will always be proven wrong, (eg. The machine's DNS domain name does not need to match the Active Directory domain).
    Unless there is a Java API to read the Windows registry or extract Kerberos ticket information from the WIndows Kerberos ticket cache, you may be kind of stuck.

  • HOW DO I FIND THE DRIVERS FOR WINDOWS 8 AUDIO AND VIDEO TO UNINSTALL?

    I NEED TO INSTALL AND UNINSTALL WINDOWS 8 DRIVERS FOR AUDIO AND VIDEO SO THAT I MAY REINSTALL THEM, BUT I DON'T KNOW WHERE TO GO TO FIND THEM IN THE FIRST PLACE.
    ALSO, IF I PURCHASE THE PROGRAM FOR UPDATING DRIVERS, WILL THAT PROGRAM ALSO INSTALL THE NEW AUDIO/VIDEO DRIVERS AND UNINSTALL THE FORMER ONES SO THAT I DON'T HAVE TO GO THROUGH SO MANY STEPS BY MYSELF. I FIND THE DIRECTIONS TO DO THIS FOR MYSELF VERY COMPLICATED.

    Hi, I would like to assist you on this matter, however I would need some information from you first.  I see that you are running windows 8. What is the make and model number of the computer that you are using?  The windows 8 that you are using, is it a 32 bit or a 64 bit operating system?  Please write back and I will be happy to do research on this issue.
    Thank you
    Waterboy71
    Click the “Kudos Thumbs Up" at the bottom of this post to say “Thanks” for helping!
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    W a t e r b o y 71
    I work on behalf of HP

  • How can I customize the opened browser window

    I need to customize the browsers to tell them not to display the address bar or any toolbars. This will be a stand alone presentation that won't connect to the web but use the browser to present. I don't want any browser details. As close to a frame as possible like a pop up window.

    When you post a question and then repost more variations of that question, the threads can grow very confusing.  This one has been answered in one of your other threads.  I am locking it.

  • How do I find the size of a selection in pixels in CC?

    Title says it all. First post. Hope it works.

    Why limit yourself to rectangle.
    Photo Collage ToolkitUPDATED April 30, 2013 Added border option to PasteImageRoll.
    Photoshop scripting is powerful and I believe this package demonstrates this.
    The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
    There are eleven scripts in this package they provide the following functions: 
    TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop. 
    CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts. 
    LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document. 
    InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text. 
    ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned. 
    ChangeTextSize.jsx - This script can be used to change Image stamps text size when the size used by the populating did not work well. 
    PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop. 
    BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text. 
    BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked. 
    BatchPicturePackage.jsx - Used to Automatically Batch Populate Any Photo Collage template with an image in a source image folder 
    PasteImageRoll.jsx - Paste Images into a document to be print on roll paper.
    Documentation and Examples

  • How to find the current running jobs.

    Hi All,
    Can u please tell me how can i find the current running jobs in oracle.
    OS : windows
    DB VERSION: 10.2.0.1
    Thanks,
    srini...

    Don't think so..
    For the running jobs ( the ones in flight right now..)
    if you used the scheduler
    select owner , job_name , running_instance, session_id from all_scheduler_running_jobs
    order by owner , job_name
    If you used dbms_job ( you really should the scheduler ...)
    select job, instance, sid from dba_jobs_running
    order by instance, job
    /

  • Finding the current iTunes version

    How do I find the current iTunes version so that I can request a track....and how do I find the operating system of my computer. I'm a complete technophobe. Can anyone help?

    You can find the iTunes version by clicking *Help... About iTunes*. Mine reads iTunes 9 and then the scrolling text reveals the version number is 9.1.1.11. If you're trying to fill out your version number in a form on the Apple website then these are usually out of date and have an option for the current build. Just use the most recent build listed.
    Your signature suggests you've already worked out that your OS is Windows XP.
    tt2

  • How can we get a alert message in  the current browser we are using the mom

    how can we get a alert message in the current browser we are using the moment we have entered some data in
    the table...
    I need a popup alert the moment a new record is added in a table... in apex database is 11g xe..
    The idea is I am using a apex application. .The moment new data is added in the table ..I am alerted by a message window..that a new record has been added...
    Thanks
    Edited by: pauljohny on Jun 11, 2012 10:23 AM

    pauljohny wrote:
    how can we get a alert message in the current browser we are using the moment we have entered some data in the table...
    "Current browser"? When viewing anything, or just when using an APEX app?
    Ans .. Just when using apex app....even if the apex app is minimised ..The current browser will be the one where I am using apex app...
    What i am looking for some scheduler .. to check ..in the table every 5 minute for change if there is a change..then a popup alert be shown...
    Split it into [at least] 2 components, database and browser. I'd expect someone calling themself a "DBA Architect" to have some ideas about the database side of things, even if not clued up on JavaScript and AJAX?
    I dont think its a database isssue... When i say to check every 5 minutes ..it could be easily done via dbms_scheduler ...I am having issue in getting the popup alert message...
    in apex... Dont know wether there is a plugin like modal window(available from skill builder) which shall help in this scenario,.Or might be have to use java scripting and ajax ..
    and if it is that (Java scripting and Ajax) .....then shall have to be familiar with java scripting and Ajax...and this shall be a bit time consuming..
    Had a feeling this could be accomplished via java scripting and ajax.. ...but still looking for some easy way..

  • How to find the current iTunes Library

    Hello,
    somehow, opening iTunes the last time I came to a previous iTunes Library and do not find the current one, where much more songs and downloads are in.
    Searching in Windows also did not help. How could I get back to the current one, as everytime opening iTunes the previous shows up.
    Does anybody know?
    Thx

    The only way is to search in Windows and look at the Size & Date Modified fields.
    Are you searching ALL your hard drives, even external ones?
    Are your Windows Explorer folder options set to hide system folders? Hide file extensions? You will need to uncheck both those options for the search to be useful.

  • How to open a URL without session ID and reuse the current browser session?

    Hi All,
    I have a question about HTMLDB 2.0
    How to open a URL without session ID and reuse the current browser session?
    That was the behaviour in HTMLDB 1.6 ...
    My usecase for this is the following:
    We have written an issue tracking application, which sends e-mail to the interested users, when something happens.
    In these email we've put a link to some page, with some parameters in the URL.
    The idea is for the user to be easy to click on the hyperlink and to see the details of the ticket.
    When the user clicks on such a link he is directed to a login screen (page 101) and he enters his Username and password, and is then forwarded to the details for the ticket.
    Then he receives another email (e.g. for another ticked). He clicks on the link and :
    a) in HTMLDB 1.6 he goes to the details as he didn't close his browser and session is remembered
    b) in HTMLDB 2.0 he is prompted to enter username, password with the username populated
    Please tell me how can I achieve the same behaviour in HTMLDB2.0 as it was in HTMLDB 1.6.
    I understand this change is somehow security related, althogh I don't understand how. If you can explain this either I would be very happy?
    Best regards,
    Mihail Daskalov

    Mihail - I detailed a couple of approaches here: Re: Application Link
    Scott

  • On the Canon MG3520 connected via Ethernet to USB on my PC with Windows 7, How do i find the IP ADD

    ON THE CANON mg3520 CONNECTED to my PC via cable to Computer with Windows 7, How do i find the IP ADDRESS for the MG3520?

    Hi biggergulp,
    To view the IP addres of your PIXMA MG3520, please follow these steps:
     1.  Click Start and select All programs, Canon Utilities, IJ Network Tool, and then IJ Network Tool.
     2.  Click on your PIXMA MG3520.
     3.  Select Configuration... from the Settings menu.
    The IP address of your PIXMA MG3520 will be displayed.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

Maybe you are looking for