Форуми / Cotonti / Support / Image Resizing

Franco
#1 07.11.2011 14:56

hi!

i'm using Senator skin, and it addapts to the screen resolution, is there a way to make images in news do the same? because they look bad on lower skin resolutions like 1024x768. 

 

it will be like making, if the screen resolution is lower than 1024 pixel width resize the image, and if not just use the slimbox plugin...

 

i think it could be done in the css, but i don't know how to detect the user resolution

pieter
#2 07.11.2011 17:24
Franco
#3 07.11.2011 18:41

but isn't that to make the entire website smaller? the only thing that looks bad are the images on the news...

 

i'll see if i can adapt it to work only there

Added 51 minutes later:

ok.. did it another way....

 

in the index i placed this

<SCRIPT LANGUAGE="JavaScript">


<!-- Begin
function redirectCSS() {

if (screen.width =< 1024)
      {document.write("<link href='/skins/senator/css/red.css' rel='stylesheet' type='text/css'>")}

else
      {document.write("<link href='/skins/senator/css/blue.css' rel='stylesheet' type='text/css'>")}
}
redirectCSS()
// End -->
</script>

Added 36 seconds later:

and then in the other css i set the image widht with this

 

img {  
max-width:400px;
}  

Відредаговано: Franco (07.11.2011 19:34, 12 років тому)