Hi, really new to all this really so please be patient
I have designed a website for my workplace that is a very rough guide basically to start with.
There are a few mages and most info still needs to be filled in.
I created the site with photoshop, and although very basic, it does what it needs to do.
The problem i have is that i would really like it to scale with the browser window.
I have searched high and low and finally found this,
-------------------------------------------------------------------
No, its not possible in html, however you are right, it does work in JavaScript, if you require the script then:
CODE
var jswidth = screen.width;
if (jswidth==800) document.write("<div class='main' style='width:63%;'>");
else if (jswidth==1024) document.write("<div class='main' style='width:72%;'>");
else if (jswidth==1152) document.write("<div class='main' style='width:75%;'>");
else if (jswidth==1280) document.write("<div class='main' style='width:77%;'>");
else document.write("<div class='main' style='width:63%;'>");
Name that file homepage.js for your convienience. Link to this file by using
CODE
<script type="text/javascript"src="/index/homepage.js"></script>
right before your main content in the homepage. Then make this file:
CODE
document.write("</div>");
Name it divclose.js. Place the following code after your content:
CODE
<script type="text/javascript"src="/index/divclose.js"></script>
This is untested, but I am almost positive it would work.
--------------------------
Sorry for messy copy and paste, but atleast hopefully i can get my question across!
Now i got this to work for me on a simple page, then tried to add this to my photoshop site through editing index.html and nothing happens?
Can anyone please help, im stumped :nuts:
Thanks in advance for any replies that can help!
Dave
I have designed a website for my workplace that is a very rough guide basically to start with.
There are a few mages and most info still needs to be filled in.
I created the site with photoshop, and although very basic, it does what it needs to do.
The problem i have is that i would really like it to scale with the browser window.
I have searched high and low and finally found this,
-------------------------------------------------------------------
No, its not possible in html, however you are right, it does work in JavaScript, if you require the script then:
CODE
var jswidth = screen.width;
if (jswidth==800) document.write("<div class='main' style='width:63%;'>");
else if (jswidth==1024) document.write("<div class='main' style='width:72%;'>");
else if (jswidth==1152) document.write("<div class='main' style='width:75%;'>");
else if (jswidth==1280) document.write("<div class='main' style='width:77%;'>");
else document.write("<div class='main' style='width:63%;'>");
Name that file homepage.js for your convienience. Link to this file by using
CODE
<script type="text/javascript"src="/index/homepage.js"></script>
right before your main content in the homepage. Then make this file:
CODE
document.write("</div>");
Name it divclose.js. Place the following code after your content:
CODE
<script type="text/javascript"src="/index/divclose.js"></script>
This is untested, but I am almost positive it would work.
--------------------------
Sorry for messy copy and paste, but atleast hopefully i can get my question across!
Now i got this to work for me on a simple page, then tried to add this to my photoshop site through editing index.html and nothing happens?
Can anyone please help, im stumped :nuts:
Thanks in advance for any replies that can help!
Dave