Stefan118
03-01-2011, 12:21 AM
Hello,
I want to place 3 banners on my forum.
The banners have to resize depending on the screen resolution of the user.
Choices are 1024x768 and 1280x1024.
This works all well.
But I also want to redirect the member to the website of the banner in an other screen.
I can't figure out how to do this.
I tried the usual <a href="................."> on different places but nothing works.
Who can help me?
I have placed the folowing script in the advertising area.
<script language="javascript" type="text/javascript" src="/templates/high_javascript.js">
<!--
//var iWidth = 0;
//var iHeight = 0;
//-->
</script>
<center>
<script type="text/Javascript">
<!--
/*initialization for IE! Leave this funtion after the body tag */
/*if(!window.Width && document.body && document.body.offsetWidth)
{
//window.onresize = recal;
//alert("line114!");
Width = windowWidth();
Height = windowHeight();
//alert(Width + "<br>" + Height);
//alert("width");
}
*/
//-->
var iWidth, iHeight, sRes;
if (window.innerWidth != null) {
//alert("first");
iWidth = window.innerWidth;
iHeight = window.innerHeight;
}
else if (document.body.clientWidth != null) {
//alert("second");
iWidth = document.body.clientWidth;
iHeight=document.body.clientHeight;
}
else {
//alert("third");
}
var imgPath1 = "left.jpg";
var imgPath2 = "center.jpg";
var imgPath3 = "right.jpg";
var imgAlt = "Click here to go to the website of the sponsor.";
if (iWidth <= 1100) {
document.write("<img src='/images/advertenties/" + imgPath1 + "' vspace='20' alt='" + imgAlt + "' width='190'>");
document.write(" ");
document.write("<img src='/images/advertenties/" + imgPath2 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
document.write(" ");
document.write("<img src='/images/advertenties/" + imgPath3 + "' vspace='20' alt='" + imgAlt + "' width='190'>");
}
else {
document.write("<img src='/images/advertenties/" + imgPath1 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
document.write(" ");
document.write("<img src='/images/advertenties/" + imgPath2 + "' vspace='20' alt='" + imgAlt + "' width='400'>");
document.write(" ");
document.write("<img src='/images/advertenties/" + imgPath3 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
}
</script>
</center>
I want to place 3 banners on my forum.
The banners have to resize depending on the screen resolution of the user.
Choices are 1024x768 and 1280x1024.
This works all well.
But I also want to redirect the member to the website of the banner in an other screen.
I can't figure out how to do this.
I tried the usual <a href="................."> on different places but nothing works.
Who can help me?
I have placed the folowing script in the advertising area.
<script language="javascript" type="text/javascript" src="/templates/high_javascript.js">
<!--
//var iWidth = 0;
//var iHeight = 0;
//-->
</script>
<center>
<script type="text/Javascript">
<!--
/*initialization for IE! Leave this funtion after the body tag */
/*if(!window.Width && document.body && document.body.offsetWidth)
{
//window.onresize = recal;
//alert("line114!");
Width = windowWidth();
Height = windowHeight();
//alert(Width + "<br>" + Height);
//alert("width");
}
*/
//-->
var iWidth, iHeight, sRes;
if (window.innerWidth != null) {
//alert("first");
iWidth = window.innerWidth;
iHeight = window.innerHeight;
}
else if (document.body.clientWidth != null) {
//alert("second");
iWidth = document.body.clientWidth;
iHeight=document.body.clientHeight;
}
else {
//alert("third");
}
var imgPath1 = "left.jpg";
var imgPath2 = "center.jpg";
var imgPath3 = "right.jpg";
var imgAlt = "Click here to go to the website of the sponsor.";
if (iWidth <= 1100) {
document.write("<img src='/images/advertenties/" + imgPath1 + "' vspace='20' alt='" + imgAlt + "' width='190'>");
document.write(" ");
document.write("<img src='/images/advertenties/" + imgPath2 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
document.write(" ");
document.write("<img src='/images/advertenties/" + imgPath3 + "' vspace='20' alt='" + imgAlt + "' width='190'>");
}
else {
document.write("<img src='/images/advertenties/" + imgPath1 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
document.write(" ");
document.write("<img src='/images/advertenties/" + imgPath2 + "' vspace='20' alt='" + imgAlt + "' width='400'>");
document.write(" ");
document.write("<img src='/images/advertenties/" + imgPath3 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
}
</script>
</center>