Current location: Hot Scripts Forums » General Web Coding » JavaScript » links not working in JS


links not working in JS

Reply
  #11 (permalink)  
Old 03-03-08, 05:02 AM
bitstomper bitstomper is offline
Newbie Coder
 
Join Date: Feb 2007
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
slightly different code (with changes in the PlaceImage function:

Code:
var Path='http://www.website.com/images/'
var ImgAry=[];
ImgAry[0]=['photos/architecture/arch_01.jpg','','<br><br>seoul airport<br>terry farrell & partners',229,250];
ImgAry[1]=['photos/architecture/arch_02.jpg','','<br><br>hong kong residence<br>adrian mccarroll architects',603,78];
ImgAry[2]=['photos/architecture/arch_03.jpg','http://www.website.com','<br><br>silodam &nbsp;&nbsp; amsterdam<br>mvrdv',638,78];
ImgAry[3]=['photos/architecture/arch_04.jpg','http://www.website.com','<br><br>kings villa &nbsp;&nbsp; beijing',472,202];
ImgAry[4]=['photos/architecture/arch_05.jpg','http://www.website.com','<br><br>library hotel &nbsp;&nbsp; koh samui',517,145];
ImgAry[5]=['photos/architecture/arch_06.jpg','http://www.website.com','<br><br>shanghai airport <br>paul andreu architect',417,225];
ImgAry[6]=['photos/architecture/arch_07.jpg','http://www.website.com','<br><br>twin towers reception<br>mpi architects',472,202];
ImgAry[7]=['photos/architecture/arch_08.jpg','http://www.website.com','<br><br>china national offshore oil company<br>kohn pederson fox architects',543,57];
ImgAry[8]=['photos/architecture/arch_09.jpg','http://www.website.com','<br><br>quanta touyuan<br>artech architects',392,249];
ImgAry[9]=['photos/architecture/arch_10.jpg','http://www.website.com/beijing_olympic.php','<br><br>beijing olympic boom &nbsp;&nbsp; to view photos &nbsp;<a href="beijing_olympic.php" style="text-decoration:none; color:#cc0000"><b>click here</b></a>',110,242];
ImgAry[10]=['photos/architecture/arch_11.jpg','http://www.website.com','<br><br>walvis &nbsp;&nbsp; amsterdam<br>frits van dongen architecten cie',517,145];
ImgAry[11]=['photos/architecture/arch_12.jpg','http://www.website.com','<br><br>office and apartment buildings in the far east',110,337];
ImgAry[12]=['photos/architecture/arch_13.jpg','http://www.website.com','<br><br>bibliotheek &nbsp;&nbsp; amsterdam<br>jo coenen architecten',596,78];
ImgAry[13]=['photos/architecture/arch_14.jpg','http://www.website.com','<br><br>banciao model house &nbsp;&nbsp; taipei<br>kuo architects',229,243];
ImgAry[14]=['photos/architecture/arch_15.jpg','http://www.website.com','<br><br>commercial building<br>neihu ksarch',472,202];
ImgAry[15]=['photos/architecture/arch_16.jpg','http://www.website.com','<br><br>exhibition center &nbsp;&nbsp; melbourne<br>denton corker marshall',594,73];
ImgAry[16]=['photos/architecture/arch_17.jpg','http://www.website.com','<br><br>childrens palace &nbsp;&nbsp; guangzho &nbsp;&nbsp;china<br>steffan bradley architects',599,78];
ImgAry[17]=['photos/architecture/arch_18.jpg','http://www.website.com','<br><br>shiatze chen factory &nbsp;&nbsp; shanghai<br>layan design group',472,202];
ImgAry[18]=['photos/architecture/arch_19.jpg','http://www.website.com','<br><br>childrens palace &nbsp;&nbsp; guangzho &nbsp;&nbsp;china<br>steffan bradley architects',472,202];
ImgAry[19]=['photos/architecture/arch_20.jpg','http://www.website.com','<br><br>pukhet residence &nbsp;&nbsp;<br>adrian mccarroll architects',472,202];
for (var zxc0=0;zxc0<ImgAry.length;zxc0++){
 ImgAry[zxc0][10]=new Image();
 ImgAry[zxc0][10].src=Path+ImgAry[zxc0][0];
}


// Functional Code

var zxcTO;
var ImgCnt=0;
var zxcEvt=0;

function zxcStyle(zxcele,zxcstyle,zxcp){
 if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
 for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
 if (zxcp){ zxcp.appendChild(zxcele); }
 return zxcele;
}

function zxcEventAdd(zxco,zxct,zxcf) {
 if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ zxco[zxcf](e);}, false); }
 else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ zxco[zxcf](e);}); }
 else {
  var zxcPrev=zxco["on" + zxct];
  if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
  else { zxco['on'+zxct]=zxco[zxcf]; }
 }
}

function zxcAddEvent(zxc,zxcfun,zxcevt){
 if (zxc.addEvent){ return; }
 zxc.addEvent=window[zxcfun];
 zxcEventAdd(zxc,zxcevt,'addEvent');
}

function zxcAddEvt(zxc,zxcfun,zxcevt){
 zxc['zxcaddEvt'+zxcEvt]=window[zxcfun];
 zxcEventAdd(zxc,zxcevt,'zxcaddEvt'+zxcEvt);
 zxcEvt++;
}

// parameters  0 = column pitch, 1 = row pitch, 2 = dot height, 3 = slide show button height
function PlaceDots(zxccol,zxcrow,zxcdotheight,zxcssheight){
 zxcnu=ImgAry.length;
 var zxcp=document.getElementById('dots');
 zxcp.removeChild(zxcp.getElementsByTagName('DIV')[0]);
 var zxclft=0;zxctop=0;
 for (var zxc0=0;zxc0<zxcnu;zxc0++){
  var zxcimg=zxcStyle('IMG',{position:'absolute',left:(Math.floor(zxc0%(zxcnu/2))*zxccol)+'px',top:(Math.floor(zxc0/(zxcnu/2))*zxcrow)+'px',cursor:(document.all)?'hand':'pointer'},zxcp);
  zxcimg.src=Path+'dots/dots'+(Math.floor(zxc0%(zxcnu/2))+1)+'.gif';
  zxcAddEvt(zxcimg,'zxcDotMse','mouseover');
  zxcAddEvt(zxcimg,'zxcDotMse','mouseout');
 }
 zxcdimg=zxcStyle('IMG',{width:'43px',height:zxcssheight+'px',position:'absolute',left:(Math.ceil(zxcnu/2)*zxccol)+'px',top:((zxcrow+zxcdotheight-zxcssheight)/2)+'px'},zxcp);
 zxcdimg.src=Path+'dots/slidedot.gif';
 zxcAddEvt(zxcdimg,'zxcStartSShow','mouseover');
 zxcAddEvt(zxcdimg,'zxcStartSShow','mouseout');
 zxcStyle(document.getElementById('Main'),{cursor:(document.all)?'hand':'pointer'});
}

function zxcDotMse(zxcevt){
 clearTimeout(zxcTO);
 var zxcdots=this.parentNode.getElementsByTagName('IMG');
 for (var zxc0=0;zxc0<zxcdots.length;zxc0++){
  if (zxcdots[zxc0]==this){
   ImgCnt=zxc0;
   break;
  }
 } 
 PlaceImage();

}

function zxcStartSShow(zxcevt){
 zxcevt.cancelBubble=true;
 if (zxcevt.stopPropagation) zxcevt.stopPropagation();
 clearTimeout(zxcTO);
 if (zxcevt.type=='mouseover'){ this.src=Path+'dots/slidedotred.gif'; SlideShow(); }
else { this.src=Path+'dots/slidedot.gif'; }
}

function SlideShow(){
 PlaceImage();
 ImgCnt=++ImgCnt%ImgAry.length;
 zxcTO=setTimeout('SlideShow()',3000);
}

function PlaceImage(){
 var zxcimg=document.getElementById('Main')
 zxcStyle(zxcimg,{left:ImgAry[ImgCnt][3]+'px',top:ImgAry[ImgCnt][4]+'px'});
 zxcimg.src=Path+ImgAry[ImgCnt][0];
 document.getElementById('text').innerHTML=ImgAry[ImgCnt][2];
 var zxca=zxcimg.parentNode;
 zxca.href=ImgAry[ImgCnt][1]||'#';
 zxca.onclick=function(){  return (this.href=='#')?false:true; }
 ResetDots();
}

function ResetDots(){
 var zxcimgs=document.getElementById('dots').getElementsByTagName('IMG');
 var zxcmid=Math.ceil((zxcimgs.length-1)/2);
 for (var zxc0=0;zxc0<zxcimgs.length-1;zxc0++){
  zxcimgs[zxc0].src=Path+'dots/dots'+((zxc0<zxcmid)?zxc0+1:zxc0-zxcmid+1)+'.gif';
 }
 zxcimgs[ImgCnt].src=Path+'dots/dotred.gif';
}

/*]]>*/
</script>

<body >

<div id="loading" style="position:absolute; left:895px;top:556px;">
<img src="../images/loading.gif" border=0 /></div>


<a href="http://www.website.com"><img src="http://www.website.com/images/name_heading.gif" width="220" height="17" style="position:absolute;left:110px;top:74px;" border="0" /></a>
<div id="text" style="position:absolute;left:110px;top:105px;width:320px;height:50px;text-Align:left;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #999999;text-decoration: none; line-height: 10pt;" ><br><br>seoul airport<br>terry farrell & partners</div>


<div id="dots" style="position:absolute;left:110px;top:176px;" >
<div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #999999;"></div>
</div >

<a href="#"><img id="Main" onclick="return false;"  src="http://www.website.com/images/photos/architecture/arch_01.jpg" style="position:absolute;left:229px;top:250px;" border="0" /></a>
<img id="Main2"  src="http://www.website.com/images/horline.gif" width="857" style="position:absolute;left:110px;top:590px;" />
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

// parameters  0 = column pitch, 1 = row pitch, 2 = dot height, 3 = slide show button height
PlaceDots(22,20,17,44);

/*]]>*/
</script>
Reply With Quote
  #12 (permalink)  
Old 03-03-08, 07:19 PM
bitstomper bitstomper is offline
Newbie Coder
 
Join Date: Feb 2007
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
It seems to work in IE wondows but not in other browsers...
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
JS script not working properly on IE but working on Firefox!!! sujata_ghosh JavaScript 4 05-21-07 05:46 AM
PHP/MySQL Script sszukala Job Offers & Assistance 0 01-28-06 02:53 PM
Premium 'featured sponsors' and partner links EvilHaider General Advertisements 0 10-07-05 03:50 PM
hey there, im creating links that arnt working any help? 0o0o0 PHP 4 10-03-05 06:37 PM


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