Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > JavaScript and CSS

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

JavaScript and CSS Extensible Markup Language, Java Script, and CSS questions here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-16-2006, 05:26 PM
streulich streulich is offline
Newbie
 
Join Date: Oct 2006
Posts: 8
Credits: 0
Rep Power: 0
streulich is on a distinguished road
Question Javascript Problem on Firefox

On my website I have javascript for a rotating image. It works fine only on IE but doesn't rotate on any other browser. Any suggestions?

Code:
<Script Language="Javascript">
<!--
var which="work.asp?c=1"

function getURL(url){
	which = url
	}

function transport(){
window.location= which
}


function jPop(what)  {
apopWindow = window.open('textPopup.asp?w=' + what, 'jPop', 'width=450,height=550,toolbar=no,location=no,scrollbars=yes' )
}
// Slide Show Script
// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 3000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = 'images/main/main01.gif';
Picture[2]  = 'images/main/main02.gif';
Picture[3]  = 'images/main/main03.gif';


// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

Caption[1]  = "work.asp?c=1&proj=A";
Caption[2]  = "work.asp?c=3&proj=A";
Caption[3]  = "work.asp?c=4&proj=A";


// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;
var link=Caption[jss]

function goToLink() { 
window.dynalink.href = Caption[jss]
} 

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
goToLink()
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</Script>

Thanks!

Last edited by Jordan; 10-17-2006 at 09:28 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 10-16-2006, 05:38 PM
Crane's Avatar   
Crane Crane is offline
Programming Expert
 
Join Date: Nov 2005
Posts: 399
Credits: 1
Rep Power: 13
Crane is on a distinguished road
Default

Hmm, looks fine from what I can tell. Are you sure that you have Javascript enabled in your other browsers? Where is a link with this code so I can test?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-16-2006, 05:42 PM
streulich streulich is offline
Newbie
 
Join Date: Oct 2006
Posts: 8
Credits: 0
Rep Power: 0
streulich is on a distinguished road
Default

the website is www.softassociates.com. The images are in the top right-hand part of the home page.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-16-2006, 07:02 PM
falco85 falco85 is offline
Programmer
 
Join Date: Apr 2006
Posts: 105
Credits: 0
Rep Power: 9
falco85 is on a distinguished road
Default

Are you talking about the Orange image that changes in IE?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10-16-2006, 07:06 PM
streulich streulich is offline
Newbie
 
Join Date: Oct 2006
Posts: 8
Credits: 0
Rep Power: 0
streulich is on a distinguished road
Default

yeah, the caption part is orange and above it says peoplesoft then two people then four blocks. any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 10-17-2006, 09:41 AM
Lop's Avatar   
Lop Lop is offline
Speaks fluent binary
 
Join Date: May 2006
Posts: 1,148
Credits: 112
Rep Power: 16
Lop will become famous soon enough
Default

In FireFox it appears that your image src always has images/main/main01.gif - How is the javascript being called to change the image??

Can you give me the URL of where you got this script?
__________________
Lop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 10-17-2006, 10:09 AM
streulich streulich is offline
Newbie
 
Join Date: Oct 2006
Posts: 8
Credits: 0
Rep Power: 0
streulich is on a distinguished road
Default

The Javascript was all handcoded, it didn't come from anywhere else. Everything is in the Source code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 10-17-2006, 12:13 PM
smith smith is offline
Programmer
 
Join Date: Jun 2006
Posts: 108
Credits: 0
Rep Power: 9
smith is on a distinguished road
Default

Your setTimeout does not work, that is the problem. I'm trying to figure out why it doesn't work right now.
__________________
Code:
for (int i;;) {
   cout << "Smith";
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 10-17-2006, 12:35 PM
smith smith is offline
Programmer
 
Join Date: Jun 2006
Posts: 108
Credits: 0
Rep Power: 9
smith is on a distinguished road
Default

The problem turned out to be your link function. Ok, problem solved. You need to change your goToLink() function to this:

Code:
function goToLink() { 
	var x=document.getElementsByName("dynalink");
	x.href = link;
}
and it will work fine.
__________________
Code:
for (int i;;) {
   cout << "Smith";
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 10-17-2006, 05:17 PM
streulich streulich is offline
Newbie
 
Join Date: Oct 2006
Posts: 8
Credits: 0
Rep Power: 0
streulich is on a distinguished road
Default

awesome! thanks so much, i really appreciate it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Peculiar UI Problem Needs Tackling adriyel C# Programming 2 04-06-2008 07:46 AM
Internet Explorer Vs Firefox mona Technology Ramble 15 10-20-2007 10:53 AM
[C] Comparison problem Alhazred C and C++ 1 08-29-2007 04:58 AM
Critical Firefox hole allows password theft Jordan Technology Ramble 31 01-22-2007 09:48 AM
Firefox flaws? mysticalone Website Design 1 01-16-2007 11:29 PM


All times are GMT -5. The time now is 07:48 PM.

Contest Stats

Xav ........ 1024.41
MeTh0Dz|Reb0rn ........ 971.17
morefood2001 ........ 850.04
John ........ 841.93
WingedPanther ........ 661.52
marwex89 ........ 575.59
Brandon W ........ 446.33
chili5 ........ 292.12
orjan ........ 187.41
Steve.L ........ 180.25

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 79%

Ads