Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...How to edit the CSS to automatically detect the screen resolution?How to edit the CSS to automatically detect the screen resolution?
Previous
 
Next
New Post
1/15/2009 3:53 PM
 

Hi,
I'm using the XDPersonalBlue skin however the picutre would not adjust to the different screen size. How can I make it automatically detect the different screen size and adjust itself?

John

 
New Post
1/15/2009 6:35 PM
 

Newer browsers allow you to detect the user's screen resolution using the screen.width and screen.height properties. This can be a helpful way to send viewers to the right version of your page, depending on their computer's screen resolution. However, I am not sure if this is useful.

If I use any of my pcs that have screen resolution above 1440 width, I normally have many windows open. Very rarely do I want to open the whole screen. Unless I want to concentrate on a page with no clutter.
 

That is probably the behaviour that most people want. so if this was done automatically then I would not be happy since the window I like to use is normally set about 900px or there about in width

This is the script that people use in static pages. So to implement it in DNN, it needs to be injectected with a script injector module.

 

<SCRIPT language="JavaScript">

<!--
if ((screen.width>=1024) && (screen.height>=768))
{
 window.location="highres.html";
}
else
{
  window.location="lowres.html";
}
//-->
</SCRIPT> 

 
New Post
7/18/2011 5:37 PM
 
hi salar,

im developing site with different background for each page and i used background size for image width 1600 px
but i need to know if there's a way to make the dnn detect the user resolution and accordingly the background image to be resized or something

you can check the page
http://zaghloulholdings.com/web/REALESTATEPORTFOLIO/GOLFCITY.aspx
 
New Post
7/18/2011 6:02 PM
 
just add an ID to the element so you can access it in the DOM and set it that way e.g.

id="mybackground">

and the following in a script block:
d = document.getElementById('mybackground');
d.style.width=screen.width;
d.style.width=screen.height;

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...How to edit the CSS to automatically detect the screen resolution?How to edit the CSS to automatically detect the screen resolution?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out