The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
At the top of the forum pages everyone obviously has their logo.
I also want to add a banner next to it - no problem. BUT. If i view it in my 1152x864 screen it looks fine. If someone in 800x600 (for example) looks at it - its all off to the right side of the screen (creating a scroll bar). How can i auto resize it to not so this? Will it involve using conditionals and differing banners to achieve the "fit on page" scenario? |
|
#2
|
||||
|
||||
|
I don't know how to do it, but to point you in the right direction, it will require the use of JavaScript to detect the users resolution.
|
|
#3
|
||||
|
||||
|
I found this code that should do what you need.
Code:
<html>
<head>
<script>
window.onload = setBanner;
function setBanner()
{
var w = screen.availWidth;
var i = document.getElementById('banner');
if (w >= 1000) {
i.src = 'image_big.jpg'
}
else if (w >= 700) {
i.src = 'image_medium.jpg'
}
else {
i.src = 'image_small.jpg'
}
}
</script>
</head>
<body>
<img id='banner' src=''>
</body>
</html>
|
|
#4
|
|||
|
|||
|
make sure that the table width is at percentage and not pixels.
example, width="50%" and not width="350pix" |
|
#5
|
|||
|
|||
|
Cheers - i'll give it a go and report back
|
|
#6
|
|||
|
|||
|
Where do you put that code?
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|