By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,624 Members | 1,747 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,624 IT Pros & Developers. It's quick & easy.

using mutiple img ids

P: 2
in the below code how can i use mutiple img ids with different Below Imgptr.

Expand|Select|Wrap|Line Numbers
  1. var ImgPtr = 1;
  2. function ChangeImage(dir) {
  3.   if (dir < 0)
  4.   {
  5.     ImgPtr--;
  6.     if (ImgPtr < 1) { ImgPtr = 1; }
  7.   }
  8.   else
  9.   {
  10.     ImgPtr++;
  11.     if (ImgPtr > 6) { ImgPtr = 6; }
  12.   }
  13.   if(document.images)
  14.   {
  15.   for( var i=1; i<6; i++ )
  16.   {
  17.   document.images [i].src ="http://bytes.com/images/"+ ImgPtr +".gif";
  18.   document.images [i].src = ImgPtr+'.gif';
  19.   }
  20.   }
  21. }
Aug 7 '09 #1
Share this Question
Share on Google+
1 Reply


Dormilich
Expert Mod 5K+
P: 8,639
what do you mean by "multiple img ids"?
Aug 7 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.