Welcome to Dream.In.Code
Getting Help is Easy!

Join 105,413 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,821 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Java Image Rotation

 
Reply to this topicStart new topic

Java Image Rotation, Managing images in a rotation

vb6_god
post 30 Jun, 2008 - 01:53 PM
Post #1


New D.I.C Head

*
Joined: 3 Dec, 2007
Posts: 19


My Contributions


Hey people,

I was just wondering if anyone could give me a sense of direction for this applicaiton. Im pretty new to java
but i basically want to see if there is a way to manage images in a banner rotation.

So far, i can get my webpage to rotate x amount of images, in a random sequence each time the page loads.
I want to see if there is a way to add a managment feature so that i can simply add new images to the rotation

Im thinking i may have to use an array or a new variable for each of the images.

here is my code

CODE

script type="text/javascript" language="JavaScript">

NumberOfImagesToRotate = 6;    // MAY BE USE A VARIABLE for file names here ???

// Specify the first and last part of the image tag.

FirstPart = '<img src="/Headers/header';
LastPart = '.jpg" height="134" width="806">';

function printImage() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart);
}

/script>


Each image is currently names 1,2,3,4,5.jpg etc...

Any ideas ..i know it can be done through VB but i want to use java smile.gif

thanks
User is offlineProfile CardPM

Go to the top of the page


level1
post 3 Jul, 2008 - 06:42 AM
Post #2


New D.I.C Head

*
Joined: 12 Jun, 2008
Posts: 34



Thanked 5 times
My Contributions


Couldn't you just add new images by following the naming sequence and upping NumberOfImagesToRotate? Or are you looking for a server side solution (like php?) to set the values for you based off file contents - cuz with that you could have php just set NumberOfImagesToRotate for you if your images follow the naming sequence.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/20/08 05:46AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month