preload rollover images

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

preload rollover images

Post by SNap »

hi,

i don't get the preloading of rolloverimages workin, can anybody tell me how this should be done?

I took my dreamweaver functions in html-head and called the function in onload of that page, but it doesn't do it :?

SNap
'welcome to the real world!' datensysteme-lenk
Jan212
Posts: 859
Joined: Wed 28. Jan 2004, 21:38
Location: Solingen
Contact:

Post by Jan212 »

put the java code in the head and the onLoad in the JS onload field in the admin section, that's right, don't know why it shouldn't work in your case - could you plz post the rendered html code of the page from head till first body tag... (1st body tag included)
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

Post by SNap »

Code: Select all

<html>
<head>
<title>Atelier-Klonowski</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">

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>
<script src="./phpwcms_template/inc_js/frontend.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="./phpwcms_template/inc_css/frontend.css">
</head>

<body background="Bilder/index_17_2_2.jpg" text="#000000" link="#FF9900" vlink="#FF9900" alink="#FF9900" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages();">
<table border="0" cellspacing="0" cellpadding="0" width="100%" background="Bilder/index_09.jpg">
Code sieht doch gut aus... oder?
[/code]
'welcome to the real world!' datensysteme-lenk
Jan212
Posts: 859
Joined: Wed 28. Jan 2004, 21:38
Location: Solingen
Contact:

Post by Jan212 »

Hi,
die function

Code: Select all

<!--
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];}}
}
//-->
ist bereits in der frontend.js im ordner templates/inc_js/
das kannst du rausnehmen, und diw swap image funktion (für rollover) kannst du mal aus dem head rusnehmen und in die frontend.js packen, wobei dort eine der swap functionen vorhanden ist...

Code: Select all

topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"
raus damit...

außerdem wird er onload so aufgerufen, wo dann auch der fehler liegt

Code: Select all

<body onLoad="MM_preloadImages('images/layoutfaxen.gif','nextone and so on')">
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

Post by SNap »

also ich habs jetzt hinbekommen, hab er nur die Bilder beim Aufruf angegeben...

Warum sollen die 0er Ränder raus? die kommen vom wcms...
'welcome to the real world!' datensysteme-lenk
Jan212
Posts: 859
Joined: Wed 28. Jan 2004, 21:38
Location: Solingen
Contact:

Post by Jan212 »

html 4.01 validation sagt dir was, w3c und so weiter? sind ungültige argumente halt...
http://validator.w3.org/
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

Post by SNap »

schon mal gehört, ja, aber wieso generiert wcms das dann? ;)
'welcome to the real world!' datensysteme-lenk
Jan212
Posts: 859
Joined: Wed 28. Jan 2004, 21:38
Location: Solingen
Contact:

Post by Jan212 »

das ist ein altes problem ;-)
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

Post by SNap »

ok. aber bei dem Seitendesign geht das halt nicht anders. Oder gibt es andere Parameter?
'welcome to the real world!' datensysteme-lenk
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

it always turn german when it gets interesting ;)
it's a conspiracy i tell you
snobba
Posts: 166
Joined: Sat 6. Mar 2004, 12:41
Location: Sweden
Contact:

Post by snobba »

pSouper wrote:it always turn german when it gets interesting ;)
it's a conspiracy i tell you
LOL

Viva le Resistance!!
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

Post by SNap »

pSouper wrote:it always turn german when it gets interesting ;)
it's a conspiracy i tell you
sry. do you want to know something?
'welcome to the real world!' datensysteme-lenk
User avatar
forefront
Posts: 96
Joined: Sun 16. May 2004, 14:13
Location: Cherryvale, KS • USA
Contact:

Post by forefront »

Is it possible to have this translated into English? I need to post a mouseover button above the navigation menu. The image is there, but it doesn't work.

It appears that 3 things are needed to make JavaScript mouseovers work with phpWCMS:

1. JavaScipt that's already in frontend.js

2. A call in the body of the page somewhere, like:

Code: Select all

<img src="img/david/listen-off.png" name="listen_online" width="200" height="25" id="listen" onMouseOver="MM_swapImage('i','','img/david/listen-on.png',1)" onMouseOut="MM_swapImgRestore()">
3. Something needs to be inserted into the onload box on the pagelayout screen:

Code: Select all

onLoad="MM_preloadImages('img/david/listen-off.png','img/david/listen-off.png')"
This doesn't work, so I'm doing something terribly wrong. I know virtually zero about JavaScript, so any help you can give me is VERY much appreciated.
Don Bledsoe
FOREFRONT INTERNET
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

Post by SNap »

MM_preLoad... is from Macromedia Dreamweaver AFAIK, so you have to put the script in HTML Head-Tag.
'welcome to the real world!' datensysteme-lenk
User avatar
forefront
Posts: 96
Joined: Sun 16. May 2004, 14:13
Location: Cherryvale, KS • USA
Contact:

Post by forefront »

Never mind ... I found my mistake ... one little slash out of place.
Don Bledsoe
FOREFRONT INTERNET
Post Reply