vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help with centering please? (https://vborg.vbsupport.ru/showthread.php?t=125250)

bashy 08-29-2006 04:43 PM

Help with centering please?
 
Hi peeps

Could someone help me with this code please, I would like the text links and the image links to be centered please...

I tried this
Code:

<center>"http://3bgraphics.hypermart.net/link/3bgraphics.gif"</center>,
<center>"http://html.digitalsea.net/htmlnow.gif"</center>,
<center>"http://www.geocities.com/~jsmaster/jsnow.gif"</center>

but it didnt work, the center tags dont usually fail me but they havent done this time :(


Code:

<script language="Javascript">
<!--

var currentdate = 0;
var core = 0;

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}

link = new initArray(
"http://3bgraphics.hypermart.net/",
"http://html.digitalsea.net/",
"http://www.javascript-page.com/"
);

image = new initArray(
"http://3bgraphics.hypermart.net/link/3bgraphics.gif",
"http://html.digitalsea.net/htmlnow.gif",
"http://www.geocities.com/~jsmaster/jsnow.gif"
);

text = new initArray(
"3B Graphics",
"Learn HTML in 7 Easy Steps",
"Nic's JavaScript Page",
);

var currentdate = new Date();
var core = currentdate.getSeconds() % image.length;
var ranlink  = link[core];
var ranimage = image[core];
var rantext  = text[core];

document.write('<a href="' +ranlink+ '" target="_blank"><img src="'+ranimage+'" border="0" alt="'+rantext+'"></a>');

//-->
</SCRIPT>


Ntfu2 08-29-2006 05:12 PM

use this
Code:

<div align="center"> "http://3bgraphics.hypermart.net/link/3bgraphics.gif"
"http://html.digitalsea.net/htmlnow.gif",
"http://www.geocities.com/~jsmaster/jsnow.gif"
</div>

If you want all three to appear on seperate lines simply add
Code:

<br />
after each one

bashy 08-29-2006 05:38 PM

Ok m8 thats great, thanks alot :)

Hi m8...just tried it, it dont work, it prvents the link and image adds from showing at all

Ntfu2 08-29-2006 06:32 PM

Try this script instead, place it where you want the image+link to appear.

Code:

<script language="JavaScript">
<!--

function random_imglink(){
  var myimages=new Array()
  //specify random images below. You can have as many as you wish
  myimages[1]="img1.gif"
  myimages[2]="img2.gif"
  myimages[3]="img3.gif"

  //specify corresponding links below
  var imagelinks=new Array()
  imagelinks[1]="http://www.link.com"
  imagelinks[2]="http://www.link.com"
  imagelinks[3]="http://www.link.net"

  var ry=Math.floor(Math.random()*myimages.length)

  if (ry==0)
    ry=1
    document.write('<div align='"center'"><a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a></div>')
}

  random_imglink()
//-->
</script>



All times are GMT. The time now is 04:29 PM.

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.02308 seconds
  • Memory Usage 1,719KB
  • 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
  • (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