PHP WEB SCRIPTS    Support Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How To Call Specific Style Based On User Screen Resolution?

 
Post new topic   Reply to topic    PHP Web Scripts Forum Index -> Link Up Gold Support & Discussion
View previous topic :: View next topic  
Author Message
quebecostarica



Joined: 05 Sep 2005
Posts: 213
Location: Costa RIca

PostPosted: Wed Oct 19, 2005 8:30 am    Post subject: How To Call Specific Style Based On User Screen Resolution? Reply with quote

Hi Richard!

I would like LUG to call (automatically) the " Simple " style templates for any client screen resolution of 800 x 600 or lower.

Possible?

Thanks

Roger Pilon, Editor
CyberCafe World Wide Resources Directory
Back to top
View user's profile Send private message Send e-mail
PHPWebScripts
Richard - Admin


Joined: 13 Jan 2003
Posts: 6233

PostPosted: Wed Oct 19, 2005 8:48 am    Post subject: Reply with quote

Add this code to the top of template index.html (to all styles but style Simple):
<SCRIPT language="JavaScript">
<!--
if ((screen.width<=800) && (screen.height<=600))
{
  window.location="styles.php?style=Simple";
}
//-->
</SCRIPT>
Back to top
View user's profile Send private message
quebecostarica



Joined: 05 Sep 2005
Posts: 213
Location: Costa RIca

PostPosted: Wed Oct 19, 2005 8:56 am    Post subject: That was a fast answer! Reply with quote

Thanks !


Very Happy

Roger Pilon, Editor
CyberCafe World Wide Resources Directory
Back to top
View user's profile Send private message Send e-mail
quebecostarica



Joined: 05 Sep 2005
Posts: 213
Location: Costa RIca

PostPosted: Sun Nov 28, 2010 4:40 pm    Post subject: Can You Update The Code For LUG 5.0 Reply with quote

Richard,

I would like again to add a java code to help the script to switch automatically to the 1000px template if resolution of surfers is 1024 x 768.

Thanks

Roger Pilon, Editor
Hydroponics Aquaponics Monster Directory
Back to top
View user's profile Send private message Send e-mail
PHPWebScripts
Richard - Admin


Joined: 13 Jan 2003
Posts: 6233

PostPosted: Sun Nov 28, 2010 5:04 pm    Post subject: Reply with quote

It can look like this:
<SCRIPT language="JavaScript">
<!--
if ((screen.width<=1000) && (screen.height<=750))
{
  window.location="styles.php?style=1000px";
}
//-->
</SCRIPT>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PHP Web Scripts Forum Index -> Link Up Gold Support & Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group