vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   I need to centre a banner rotator code please (https://vborg.vbsupport.ru/showthread.php?t=262694)

gemmk1 04-26-2011 09:49 PM

I need to centre a banner rotator code please
 
I need to centre the banner code ive tried adding the <centre></centre> but cant do it.It is a banner roatator code it sits to the left of my forum.I tried the banner rotator mods but could not get them working.This works it just does not sit to the centre

Here is the code thank you

Code:

<script>
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
function create() {
        this.width = ''
        this.height = ''
        this.src = ''
        this.href = ''
        this.border = ''
        this.mouseover = ''
        this.sponsor = ''
}
ads = new Array()
for(var i=1; i<=5; i++) { ads[i] = new create() }

ads[1].width = "468"
ads[1].height = "60"
ads[1].src = "http://209.85.12.237/30111/6/0/f5128781/GDAdsBanner.gif"
ads[1].href = "http://gdforum.net"
ads[1].border = "0"
ads[1].mouseover = "Click here to enter the gd forum"
ads[1].sponsor = "best general chat forum around"

ads[2].width = "468"
ads[2].height = "60"
ads[2].src = "http://209.85.12.237/30111/6/0/f5144304/s2f3.png"
ads[2].href = "http://s2fpromotion.co.uk"
ads[2].border = "0"
ads[2].mouseover = "s2f promotion"
ads[2].sponsor = "best free promotion website around"

ads[3].width = "287"
ads[3].height = "60"
ads[3].src = "http://simplythebest.net/images/stbnetmain.gif"
ads[3].href = "http://simplythebest.net"
ads[3].border = "0"
ads[3].mouseover = "Do we need to say more?"
ads[3].sponsor = "Simply the Best"

ads[4].width = "468"
ads[4].height = "60"
ads[4].src = "http://i42.photobucket.com/albums/e303/jlmf/logo-2.gif"
ads[4].href = "http://strangers2friends.co.uk"
ads[4].border = "0"
ads[4].mouseover = "friendship and support forum"
ads[4].sponsor = "strangers 2 friends"



var n = Math.random() + ''
n = parseInt(n.charAt(5))
if(n >5) {
        n = n - 5
}
else if(n==0) {
        n = n + 5
}
n += ""

var image = ads[n]
var ad = ""
ad += '<a href="' + image.href + '" \n'
ad += 'onMouseOver="self.status=\'' + image.mouseover + '\'\;return true" \n'
ad += 'onMouseOut="self.status=\'\'"> \n'
ad += '<img src="' + image.src + '" width=' + image.width
ad += '\n height=' + image.height + ' border=' + image.border
ad += '\n><br>Please visit our sponsor: ' + image.sponsor + '</a>'
</script>




<script language="JavaScript">
<!-- hiding this script
document.write(ad)
// -->
</script>


Thank you in advance

bananalive 04-26-2011 10:04 PM

Quote:

Originally Posted by gemmk1 (Post 2189047)
I need to centre the banner code ive tried adding the <centre></centre> but cant do it.It is a banner roatator code it sits to the left of my forum.I tried the banner rotator mods but could not get them working.This works it just does not sit to the centre

Here is the code thank you
Code:

...

Thank you in advance

I've highlighted in red lines to change:

Code:

<script>
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
function create() {
        this.width = ''
        this.height = ''
        this.src = ''
        this.href = ''
        this.border = ''
        this.mouseover = ''
        this.sponsor = ''
}
ads = new Array()
for(var i=1; i<=5; i++) { ads[i] = new create() }

ads[1].width = "468"
ads[1].height = "60"
ads[1].src = "http://209.85.12.237/30111/6/0/f5128781/GDAdsBanner.gif"
ads[1].href = "http://gdforum.net"
ads[1].border = "0"
ads[1].mouseover = "Click here to enter the gd forum"
ads[1].sponsor = "best general chat forum around"

ads[2].width = "468"
ads[2].height = "60"
ads[2].src = "http://209.85.12.237/30111/6/0/f5144304/s2f3.png"
ads[2].href = "http://s2fpromotion.co.uk"
ads[2].border = "0"
ads[2].mouseover = "s2f promotion"
ads[2].sponsor = "best free promotion website around"

ads[3].width = "287"
ads[3].height = "60"
ads[3].src = "http://simplythebest.net/images/stbnetmain.gif"
ads[3].href = "http://simplythebest.net"
ads[3].border = "0"
ads[3].mouseover = "Do we need to say more?"
ads[3].sponsor = "Simply the Best"

ads[4].width = "468"
ads[4].height = "60"
ads[4].src = "http://i42.photobucket.com/albums/e303/jlmf/logo-2.gif"
ads[4].href = "http://strangers2friends.co.uk"
ads[4].border = "0"
ads[4].mouseover = "friendship and support forum"
ads[4].sponsor = "strangers 2 friends"



var n = Math.random() + ''
n = parseInt(n.charAt(5))
if(n >5) {
        n = n - 5
}
else if(n==0) {
        n = n + 5
}
n += ""

var image = ads[n]
var ad = "<div style=\"text-align:center;\">"
ad += '<a href="' + image.href + '" \n'
ad += 'onMouseOver="self.status=\'' + image.mouseover + '\'\;return true" \n'
ad += 'onMouseOut="self.status=\'\'"> \n'
ad += '<img src="' + image.src + '" width=' + image.width
ad += '\n height=' + image.height + ' border=' + image.border
ad += '\n><br>Please visit our sponsor: ' + image.sponsor + '</a></div>'
</script>




<script language="JavaScript">
<!-- hiding this script
document.write(ad)
// -->
</script>


gemmk1 04-26-2011 10:15 PM

Thank you so much that worked a charm for me

sorry the only think now is no one can click them they show but it does nothing if you click it

bananalive 04-27-2011 08:44 PM

Quote:

Originally Posted by gemmk1 (Post 2189056)
Thank you so much that worked a charm for me

sorry the only think now is no one can click them they show but it does nothing if you click it

Try changing this line:

Code:

var ad = "<div style=\"text-align:center;\""
to

Code:

var ad = "<div style=\"text-align:center;\">"


All times are GMT. The time now is 06:43 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.01138 seconds
  • Memory Usage 1,734KB
  • 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
  • (5)bbcode_code_printable
  • (2)bbcode_quote_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