Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: JavaScript conflict?  (Read 3623 times)

0 Members and 1 Guest are viewing this topic.

Gazab

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • Murcia Golf
JavaScript conflict?
« on: March 21, 2007, 12:59:05 am »

Hi,

I have recently added FrontPage buttons to my sub menu navigation. We have noticed that this could be giving some kind of JavaScript conflict and now we cannot view our images full size!

I know the obvious solution is to change the buttons but I really would like to keep them.

Any ideas on how I may resolve this would be much appreciated.

Thanks
« Last Edit: March 21, 2007, 12:52:27 pm by Nibbler »
Logged
Murcia Golf Home of our gallery. Web design by Affordable Web Design

Nibbler

  • Guest
Re: JavaScript conflict?
« Reply #1 on: March 21, 2007, 01:01:01 am »

Post a link and review the FAQ.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: JavaScript conflict?
« Reply #2 on: March 21, 2007, 09:21:12 am »

Did you use the wannabe-editor MS Frontpage to edit Coppermine files? You mustn't. Frontpage is notorious to "beautify" code in a way that actually destroys the file.
Logged

Gazab

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • Murcia Golf
Re: JavaScript conflict?
« Reply #3 on: March 21, 2007, 10:58:21 am »

Hi Gau GAu,

Thanks for your advice….I am not an authority on editors so cannot really comment on the strengths or weaknesses of either FrontPage or, say, Dreamweaver.
I will take on board your comments and look at making the change over to the preferred option. It’s something I’ve been meaning to do for a while but its easier working with what you know….
Here is the piece of JavaScript that FrontPage generated for its buttons. I use the same piece of script within my forum environment and don’t appear to have any problems there!

Code: [Select]
<script language="JavaScript">
<!--
function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}
// -->
</script>

I guess I'll have to live with this short term.
Logged
Murcia Golf Home of our gallery. Web design by Affordable Web Design

Nibbler

  • Guest
Re: JavaScript conflict?
« Reply #4 on: March 21, 2007, 11:05:41 am »

No reason to live with it, do as suggested and post a link.
Logged

Gazab

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • Murcia Golf
Re: JavaScript conflict?
« Reply #5 on: March 21, 2007, 11:16:07 am »

Nibbler, Gau Gau,

Please forgive me....I have taken another look and discovered that I must have deleted the existing Script line for scripts.js!
Needless to say we are working again now. ;D

Many thanks for your help and advise, Coppermine is a great piece of work....
Logged
Murcia Golf Home of our gallery. Web design by Affordable Web Design
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.