[SOLVED] Help for a Noob

This is a discussion on "[SOLVED] Help for a Noob" within the JavaScript Forum section. This forum, and the thread "[SOLVED] Help for a Noob are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Sep 27th, 2007, 11:05
New Member
Join Date: Sep 2007
Location: uk
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Help for a Noob

Hi there I have recently tried to learn javascript but am now stuck.

I have the following javascript in the head:
Code: Select all
<SCRIPT LANGUAGE="JavaScript">

var theImages = new Array() 

theImages[0] = 'clip1.wmv'
theImages[1] = 'clip2.wmv'
theImages[2] = 'clip3.wmv'
theImages[3] = 'clip4.wmv'



var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<embed src="'+theImages[whichImage]+'">');
}


</script>
and then the following in the body:
Code: Select all
<script type="text/javascript">
showImage();
</script>
What i want to know is how to position the showImage(); in an absolute position on the page. Currently it is in the top left corner but i want in 200px from the left and 500px from the top.

Can anyone show me what code I would have to change to get this to work?

Many Thanks,
Fodder

Last edited by karinne; Sep 27th, 2007 at 12:35. Reason: Please use the vBcode [ code ] when inserting code in your post.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Sep 27th, 2007, 11:13
Reputable Member
Join Date: Apr 2007
Location: Scotland
Age: 17
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help for a Noob

If it's just absolute positioning you want help with, that's CSS.

Add this to your CSS file.

Code: Select all
#showImage {
  position: absolute;
  top: 500px;
  left: 200px;
}
Then add this to your embed in the JavaScript.

document.write('<embed id="showImage" src="'+theImages[whichImage]+'">');
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Sep 27th, 2007, 11:22
New Member
Join Date: Sep 2007
Location: uk
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help for a Noob

thanks that worked superbly
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Noob looking for help Gardenworks Starting Out 2 Apr 6th, 2008 15:57
Very noob, very noob... jeremism30 Starting Out 3 Feb 2nd, 2008 19:29
noob needs help louie2k2 Flash & Multimedia Forum 1 Aug 5th, 2007 17:56
Noob needs help. Geekmation Flash & Multimedia Forum 3 Jan 14th, 2007 23:51
Need HELP , IM A NOOB matto Web Page Design 30 Aug 21st, 2006 03:50


All times are GMT. The time now is 09:24.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42