Strona zależna od rozdzielczości

srebny

Avatar: srebny

2008-12-08 11:18

Witam
Jak i gdzie dodać kod js odpowiedzialny za wybór grafiki w body wa zależności od rodzielczości ekranu?

» Quick.Cms v2.x

Kamil

srebny

Avatar: srebny

2008-12-08 12:27

Lub gdzie wpisać wybór pliku css w zalezności od rozdzielczości (też js)
Kod do wyboru css:
<!-- Set default stylesheet for Netscape users at 800 x 600 -->
<link rel="stylesheet" type="text/css" href="netscape.css">
<!-- Set variable stylesheets for Internet Explorer users -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Bob Pearson and Leah Murray (bob@pagecraft.on.ca) -->
<!-- Web Site: http://www.pagecraft.on.ca -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
//document.write('Your settings are ' + screen.width + ' x ' + screen.height + '');
if (screen.width == 640) {
document.write('<link rel="stylesheet" type="text/css" href="640.css">');
//alert("Style Sheet for 640 x 480 would have been loaded.");
}
if (screen.width == 800) {
document.write('<link rel="stylesheet" type="text/css" href="800.css">');
//alert("Style Sheet for 800 x 600 would have been loaded.");
}
if (screen.width == 1024) {
document.write('<link rel="stylesheet" type="text/css" href="1024.css">');
//alert("Style Sheet for 1024 x 768 would have been loaded.");
}
if (screen.width == 1280) {
document.write('<link rel="stylesheet" type="text/css" href="1280.css">');
//alert("Style Sheet for 1280 x 960 would have been loaded.");
}
if (screen.width == 1600) {
document.write('<link rel="stylesheet" type="text/css" href="1600.css">');
//alert("Style Sheet for 1600 x 1200 would have been loaded.");
}
// End -->
</script>

Kamil

treewood (OpenSolution)

Avatar: treewood

2008-12-09 08:09

sproboj w templates/container.tpl w bloku HEAD

srebny

Avatar: srebny

2008-12-09 14:37

:) Fakt , ja wstawiałem do body i dlatego były problem.
Człowiek całe życie uczy się na swoich błędach :(
Pozdrawiam

Kamil

Do góry
o nas | kontakt