vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   SOLVED can't link to site from banner (https://vborg.vbsupport.ru/showthread.php?t=259615)

Stefan118 03-01-2011 12:21 AM

SOLVED can't link to site from banner
 
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.

HTML Code:

<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("&nbsp;&nbsp;");
    document.write("<img src='/images/advertenties/" + imgPath2 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
    document.write("&nbsp;&nbsp;");
    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("&nbsp;&nbsp;&nbsp;&nbsp;");
    document.write("<img src='/images/advertenties/" + imgPath2 + "' vspace='20' alt='" + imgAlt + "' width='400'>");
    document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
    document.write("<img src='/images/advertenties/" + imgPath3 + "' vspace='20' alt='" + imgAlt + "' width='250'>");
        }

</script>

</center>


Lynne 03-01-2011 01:50 AM

Can you post your code with the URL in it that you tried to add so we can see what was wrong?

Stefan118 03-01-2011 01:04 PM

I fixed it.

What i did was this:
HTML Code:

document.write("<a href="http://www.hondaciviccrewapeldoorn.nl"><img src='/images/advertenties/" + imgPath1 + " alt='" + imgAlt + "' width='250'></a>");
What i had to do was this:
HTML Code:

document.write("<a href=http://www.hondaciviccrewapeldoorn.nl><img src='/images/advertenties/" + imgPath1 + "' alt='" + imgAlt + "' width='190'></a>");
The only diffrence between them are the " " infront and after the link.
<a href="http://www.hondaciviccrewapeldoorn.nl">
<a href=http://www.hondaciviccrewapeldoorn.nl>

Took me only more than 2 days!

Lynne 03-01-2011 03:33 PM

Did you try just escaping the quotes?
HTML Code:

document.write("<a href=\"http://www.hondaciviccrewapeldoorn.nl\"><img src='/images/advertenties/" + imgPath1 + " alt='" + imgAlt + "' width='250'></a>");


All times are GMT. The time now is 07:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02093 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete