Machuss Posted August 25, 2005 Report Share Posted August 25, 2005 (edited) Šī nav mana profesija, lapas taisu priekš sevis nevis priekš citiem, tādēļ varbūt kāds var palīdzēt manuprāt vienkāršā PHP lietā. Mēģināju atrast paraugus, varbūt ir iespējams tā, ja izšķirtspēja ir 640x480 tad lapa lieto "mazs.css" .. ja 800x600 tad "videejs.css" bet ja 1024x768 un lielaaks tad "lielizmera.css" .. P.S. Ceru ka pārāk stūlbi neizteicos :huh: Edited August 25, 2005 by Machuss Link to comment Share on other sites More sharing options...
Delfins Posted August 25, 2005 Report Share Posted August 25, 2005 Javascriptā taisam f-ju lai `onload`, kas ieimportētu konkrētu CSS failu. Link to comment Share on other sites More sharing options...
Machuss Posted August 25, 2005 Author Report Share Posted August 25, 2005 (edited) Bet varbuut iespeejams ar php paliidziibu mainiit HTML kodaa to "nosaukums".css ?? Ar JavaScript veel jo mazaak protu straadaat Edited August 25, 2005 by Machuss Link to comment Share on other sites More sharing options...
bubu Posted August 25, 2005 Report Share Posted August 25, 2005 PHP darbojās uz servera (!! nevis klienta), kur nav zināms kāds klients veic pieprasījumu. To var tikai noskaidrot, kad pirmais pieprasījums jau veikts. Tāpēc arī Javaskripts vajadzīgs, kurš onload eventā iedarbosies pēc pieprasījuma veikšanas. Link to comment Share on other sites More sharing options...
Machuss Posted August 25, 2005 Author Report Share Posted August 25, 2005 Vai kāds varētu sniegt kādu paraugu? :ph34r: Link to comment Share on other sites More sharing options...
Delfins Posted August 25, 2005 Report Share Posted August 25, 2005 cik maksāsi? :angry: Link to comment Share on other sites More sharing options...
Machuss Posted August 25, 2005 Author Report Share Posted August 25, 2005 Labi jau labi :blink: , meegjinu jau kautko mekleet! tikai nezinu ar ko lai saak. Link to comment Share on other sites More sharing options...
bubu Posted August 25, 2005 Report Share Posted August 25, 2005 (edited) Tikai atceries, ka uz visiem browseriem tas nestrādās: <script type="text/javascript> <!-- function AddStyleSheet() { if (document.createElement){ var css = document.createElement('link'); css.rel = 'stylesheet'; css.media = 'all'; css.type = 'text/css'; if (screen.width<800) { css.href = "mazs.css"; } else if (screen.width==800) { css.href = "videejs.css"; } else { // >800 css.href = "liels.css"; } var head = document.getElementsByTagName("head")[0]; head.appendChild(css); } } if (window.addEventListener) { window.addEventListener("load", AddStyleSheet, false); } else if (window.attachEvent) { window.attachEvent("onload", AddStyleSheet); } else { window.onload = AddStyleSheet; } // --> </script> Edited August 25, 2005 by bubu Link to comment Share on other sites More sharing options...
Recommended Posts