Current location: Hot Scripts Forums » General Web Coding » JavaScript » Immediate Javascript Help Needed - Image Rotation


Immediate Javascript Help Needed - Image Rotation

Reply
  #1 (permalink)  
Old 07-11-06, 12:49 PM
170Designs 170Designs is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Immediate Javascript Help Needed - Image Rotation

I have this script where I upload many images at once then I can rotate them individually through a Javascript script. The Javascript rotation works perfectly with few images but messes up with a lot of images. When there are a lot of images uploaded at once, if I click to rotate one of the images, it actually rotates another image. I ran this by someone else and he said "that's probably because the array containing the image names is out of order."

My site is http://www.gigmax.com. If you want to see the problem yourself, just login as username account2 and password account2 and go to the Create Album tab in the My Gigmax section. After you do that, go ahead and select like 20+ images (of any size) then Upload them. Once you do that, you will see what I mean on the next screen when you try to rotate them.

Here is the code:
Code:
function step_2_rotate(o_src)
{
    var i_event_row;
    if (o_src.id.match(/(\d+)$/)) {        
        i_event_row = Number(RegExp.$1);
        var i_angle = o_src.id.indexOf('left') >= 0 ? 3 : 1;
        
        var row_this = -1;
        for (i = 0; i < o_files_data.length && (row_this < 0); i++) {
            if (o_files_data[i].index == i_event_row) {
                o_files_data[i].angle = (Number(o_files_data[i].angle) + i_angle) % 4;
                row_this = i;
            }               
        }        
        step_2_draw_table();        
    }
}
Thanks,
Matt
Reply With Quote
  #2 (permalink)  
Old 07-13-06, 11:10 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
I'm afraid I can't locate exactly where this script is used...
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to rebuild image rotation javascript to perform similar, but at the sa RomanRusso JavaScript 1 05-05-06 01:36 PM
Image Rotation Script RTAdams89 Script Requests 4 04-01-06 06:11 PM
Random Image Rotation mikeyfaces Script Requests 0 10-09-05 01:48 PM
using javascript in php for image changing with drop down menu developer_x PHP 0 02-13-05 08:26 AM
small image script needed. graham barnes Script Requests 0 06-18-04 03:06 AM


All times are GMT -5. The time now is 11:14 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.