/    Sign up×
Community /Pin to ProfileBookmark

Increasing size of image on

I am using a javascript to make uploaded jpgs into a movie (weather radar) I would like to enlarge the image movie size. Each time I try to change the code an error occurs. Wondered if one of you pros could highlight the line to correctly modify the image size. I am not locked into the code, it is borrowed already. My desire it to view the images in better resolution!
Currently the image size uploaded is either 1240X1240 or 1000X1000.

Any help is greatly appreaciated!

Thanks!

I am not locked into the table look either. It keeps it clean but could opt for another view. If you could direct me to a better look or more up to date code that would be great!

<SCRIPT LANGUAGE=”JavaScript”>

//********* SET UP THESE VARIABLES – MUST BE CORRECT!!!*********************

modImages = new Array();

modImages[0] = “http://www.baycrestfl.com/radar/ktbw_br3_9.jpg“;

modImages[1] = “http://www.baycrestfl.com/radar/ktbw_br3_8.jpg“;

modImages[2] = “http://www.baycrestfl.com/radar/ktbw_br3_7.jpg“;

modImages[3] = “http://www.baycrestfl.com/radar/ktbw_br3_6.jpg“;

modImages[4] = “http://www.baycrestfl.com/radar/ktbw_br3_5.jpg“;

modImages[5] = “http://www.baycrestfl.com/radar/ktbw_br3_4.jpg“;

modImages[6] = “http://www.baycrestfl.com/radar/ktbw_br3_3.jpg“;

modImages[7] = “http://www.baycrestfl.com/radar/ktbw_br3_2.jpg“;

modImages[8] = “http://www.baycrestfl.com/radar/ktbw_br3_1.jpg“;

modImages[9] = “http://www.baycrestfl.com/radar/ktbw_br3_0.jpg“;

first_image = 1;

last_image = 10;

//=== THE CODE STARTS HERE – no need to change anything below ===

//=== global variables ====

theImages = new Array(); //holds the images

imageNum = new Array(); //keeps track of which images to omit from loop

normal_delay = 100;

delay = normal_delay; //delay between frames in 1/100 seconds

delay_step = 30;

delay_max = 6000;

delay_min = 30;

dwell_multipler = 3;

dwell_step = 1;

end_dwell_multipler = dwell_multipler;

start_dwell_multipler = dwell_multipler;

current_image = first_image; //number of the current image

timeID = null;

status = 0; // 0-stopped, 1-playing

play_mode = 0; // 0-normal, 1-loop, 2-sweep

size_valid = 0;

//===> Make sure the first image number is not bigger than the last image number

if (first_image > last_image)

{

var help = last_image;

last_image = first_image;

first_image = help;

}

//===> Preload the first image (while page is downloading)

theImages[0] = new Image();

theImages[0].src = modImages[0];

imageNum[0] = true;

//===> Stop the animation

function stop()

{

//== cancel animation (timeID holds the expression which calls the fwd or bkwd function) ==

if (status == 1)

clearTimeout (timeID);

status = 0;

}

//===> Display animation in fwd direction in either loop or sweep mode

function animate_fwd()

{

current_image++; //increment image number

//== check if current image has exceeded loop bound ==

if (current_image > last_image) {

if (play_mode == 1) { //fwd loop mode – skip to first image

current_image = first_image;

}

if (play_mode == 2) { //sweep mode – change directions (go bkwd)

current_image = last_image;

animate_rev();

return;

}

}

//== check to ensure that current image has not been deselected from the loop ==

//== if it has, then find the next image that hasn’t been ==

while (imageNum[current_image-first_image] == false) {

current_image++;

if (current_image > last_image) {

if (play_mode == 1)

current_image = first_image;

if (play_mode == 2) {

current_image = last_image;

animate_rev();

return;

}

}

}

document.animation.src = theImages[current_image-first_image].src; //display image onto screen

document.control_form.frame_nr.value = current_image; //display image number

delay_time = delay;

if ( current_image == first_image) delay_time = start_dwell_multipler*delay;

if (current_image == last_image) delay_time = end_dwell_multipler*delay;

//== call “animate_fwd()” again after a set time (delay_time) has elapsed ==

timeID = setTimeout(“animate_fwd()”, delay_time);

}

//===> Display animation in reverse direction

function animate_rev()

{

current_image–; //decrement image number

//== check if image number is before lower loop bound ==

if (current_image < first_image) {

if (play_mode == 1) { //rev loop mode – skip to last image

current_image = last_image;

}

if (play_mode == 2) {

current_image = first_image; //sweep mode – change directions (go fwd)

animate_fwd();

return;

}

}

//== check to ensure that current image has not been deselected from the loop ==

//== if it has, then find the next image that hasn’t been ==

while (imageNum[current_image-first_image] == false) {

current_image–;

if (current_image < first_image) {

if (play_mode == 1)

current_image = last_image;

if (play_mode == 2) {

current_image = first_image;

animate_fwd();

return;

}

}

}

document.animation.src = theImages[current_image-first_image].src; //display image onto screen

document.control_form.frame_nr.value = current_image; //display image number

delay_time = delay;

if ( current_image == first_image) delay_time = start_dwell_multipler*delay;

if (current_image == last_image) delay_time = end_dwell_multipler*delay;

//== call “animate_rev()” again after a set amount of time (delay_time) has elapsed ==

timeID = setTimeout(“animate_rev()”, delay_time);

}

//===> Changes playing speed by adding to or substracting from the delay between frames

function change_speed(dv)

{

delay+=dv;

//== check to ensure max and min delay constraints have not been crossed ==

if(delay > delay_max) delay = delay_max;

if(delay < delay_min) delay = delay_min;

}

//===> functions that changed the dwell rates.

function change_end_dwell(dv) {

end_dwell_multipler+=dv;

if ( end_dwell_multipler < 1 ) end_dwell_multipler = 0;

}

function change_start_dwell(dv) {

start_dwell_multipler+=dv;

if ( start_dwell_multipler < 1 ) start_dwell_multipler = 0;

}

//===> Increment to next image

function incrementImage(number)

{

stop();

//== if image is last in loop, increment to first image ==

if (number > last_image) number = first_image;

//== check to ensure that image has not been deselected from loop ==

while (imageNum[number-first_image] == false) {

number++;

if (number > last_image) number = first_image;

}

current_image = number;

document.animation.src = theImages[current_image-first_image].src; //display image

document.control_form.frame_nr.value = current_image; //display image number

}

//===> Decrement to next image

function decrementImage(number)

{

stop();

//== if image is first in loop, decrement to last image ==

if (number < first_image) number = last_image;

//== check to ensure that image has not been deselected from loop ==

while (imageNum[number-first_image] == false) {

number–;

if (number < first_image) number = last_image;

}

current_image = number;

document.animation.src = theImages[current_image-first_image].src; //display image

document.control_form.frame_nr.value = current_image; //display image number

}

//===> “Play forward”

function fwd()

{

stop();

status = 1;

play_mode = 1;

animate_fwd();

}

//===> “Play reverse”

function rev()

{

stop();

status = 1;

play_mode = 1;

animate_rev();

}

//===> “play sweep”

function sweep() {

stop();

status = 1;

play_mode = 2;

animate_fwd();

}

//===> Change play mode (normal, loop, swing)

function change_mode(mode)

{

play_mode = mode;

}

//===> Load and initialize everything once page is downloaded (called from ‘onLoad’ in <BODY>)

function launch()

{

for (var i = first_image + 1; i <= last_image; i++)

{

theImages[i-first_image] = new Image();

theImages[i-first_image].src = modImages[i-first_image];

imageNum[i-first_image] = true;

document.animation.src = theImages[i-first_image].src;

document.control_form.frame_nr.value = i;

}

// this needs to be done to set the right mode when the page is manually reloaded

change_mode (1);

fwd();

}

//===> Check selection status of image in animation loop

function checkImage(status,i)

{

if (status == true)

imageNum[i] = false;

else imageNum[i] = true;

}

//==> Empty function – used to deal with image buttons rather than HTML buttons

function func()

{

}

//===> Sets up interface – this is the one function called from the HTML body

function animation()

{

count = first_image;

}

// –>

</SCRIPT>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@temp_user123Jul 09.2007 — Post too much code and nobody wants to look at it. Isolate (show) just the HTML for the image and just the few lines of JavaScript where you're trying to change the dimensions. Thanks.
×

Success!

Help @noid1037 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...