Is there is a Java Script that will Find is Res of the screen and resize mysite to fit

Posted on 2011-11-01
Last Modified: 2012-06-27
Hi all
I know it is not a good fix but i need this as a quick one to make it work, i was wonding if there was a java script out there that i can add to my site so it resizes it to fit on there screen, i need this one in a rush as i need to show the client tomorrow, he failted to tell me and even in the spec that there is a screen size he wanted

any help would be great
Question by:awolarczuk
    LVL 12

    Accepted Solution

    Size information is available in the screen object.

    alert('Screen resolution is '+screen.width+'x'+screen.height)

    You may use this information to direct your user to an appropriate page, resize your browser window, or to modify the content of your web page.

    Resize window:

    Modify HTML:
    LVL 53

    Expert Comment

    There is no way of knowing what the script needs to change without seeing HTML and CSS.  If elements dimensions are expressed in percentages then all that is needed is to set the width if the body to 100%.  However if there are fixed dimensions on all or some elements or if absolute positioning is used, then it will required detailed scripting for each such page.

    So what exactly does the code currently look like?


    Author Comment

    i am at work atm and will show you the code tonight thanks for the feed back

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 for Beginning Beginners

    Are you looking for an efficient introduction to HTML5? Have you tried other HTML5 courses and found them too complex? Do you need just the basics of HTML5 to use with Wordpress or other content management system? If you said yes to any of these questions, this course is for you.

    Suggested Solutions

    Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now