PDA

View Full Version : Help me with my lizard script



Diana
04-03-2007, 12:24 PM
Hi,

Here a pretty script which posts lizards, but I am not able to make it function under IE.

see here on my webServer:

http://isis.no-ip.info/site/

The lizards, are blocked in top in IE.

Sorry for my english...:(

Thank you.

jscheuer1
04-03-2007, 01:10 PM
I was able to get it to work in IE by changing:


win_height=document.body.clientHeight;
win_width=document.body.clientWidth;

in javascripts/salamandes/aniMagiX.js to:


win_height=iecompattest().clientHeight;
win_width=iecompattest().clientWidth;

and then placing this function at the beginning of that file:


function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

Notes: This changed the scroller a bit but, it still worked.

Diana
04-03-2007, 02:25 PM
I am happy :D

many thanks jscheuer1

big kiss to you ! :p

it run now in IE ;)

thank you very much :)

Diana
04-03-2007, 02:48 PM
excuse me,

I have to forget you ask: Can one add OnMouseOver, so that the lizard move when the mouse is on them ?

thanks

jscheuer1
04-03-2007, 04:54 PM
Still in javascripts/salamandes/aniMagiX.js (additions/changes red):


function checkOnMouseOver(e,n,we){
var we=we? we : window.event;
printToDebug("checkOnMouseOver( "+e+","+n+")");
sp=AMXs[n];
cState=sp.status.current_state_name;
cScenario=sp.status.current_scenario_name;
printToDebug(" curren state/scenario: "+cState+","+cScenario+")");
with(states[cState].scenarios[cScenario]){
if(isIE||isNS5){
xDelta=(we.pageX? we.pageX : iecompattest().scrollLeft+we.x)-sp.pos.x;
yDelta=(we.pageY? we.pageY : iecompattest().scrollTop+we.y)-sp.pos.y;
}else{
xDelta=e.la . . .

and:


function AMXspritesHTML(){
AMXspritesHTML=""
container="span";
for(i=0;i<AMXq;i++){
if(isIE||isNS5)
clickCode1=' onClick="checkOnClick(0,'+i+')"'+' onMouseOver="checkOnMouseOver(0,'+i+',event)"';
else
clickCode1="";
AMXspritesHTML=AMXspri . . .

Note: It doesn't work every time with every lizard but, most of the time. I'm not sure why.

I also figured out how to make the scroller look the way it did at first in FF:


<div class="conteneur_defile" style="width:185px;margin-left:-3px;">
<span id="defile" style="width:185px;" onmouseover="clearInterval(timer)" onmouseout='timer=setInterval("texteDefile()",30)'>
<h3>Partenaires Sociaux :D</h3><br><br>
<span onclick="javas . . .

But, it might be better as it is now.

Diana
04-03-2007, 07:33 PM
good evening jscheuer1 :)

Thank you for the modifications, it work fine !:)

But I do not understand why you have to add CSS here whereas I already have for this script that CSS !


.conteneur_defile{position:relative;width:100px;height:600px;margin:0 auto;overflow:hidden;padding:10px;}
.conteneur_defile2{position:relative;width:100px;height:200px;margin:0 auto;overflow:hidden;padding:10px;}
#defile{position:absolute;width:100px;text-align:center;}

I work also on this script, so that it is used with several Class in css. I manage rather well in php but the Javascript is very hard for me : (

The script uses only the ID and not Class .

I had changed that:


if (!defile) defile = document.getElementById('defile');

in


if (!defile) defile = document.getElementByClassName('defile');

But it is not good :mad:

I believe that a function should be created, but I do not have enough knowledge Javascript to create it. :(

Many Thanks

jscheuer1
04-03-2007, 08:13 PM
I put the style inline just as an example. If it works well, you can put it in the stylesheet:


.conteneur_defile{position:relative;height:600px;margin:0 auto;width:185px;margin-left:-3px;overflow:hidden;padding:10px;}
.conteneur_defile2{position:relative;width:100px;height:200px;margin:0 auto;overflow:hidden;padding:10px;}
#defile{position:absolute;width:185px;text-align:center;}

But, if that messes up your other pages, just leave it inline on the one page. Or, don't use it at all, it is up to you, whatever you like. I was just trying to make it look the way it did when I first viewed your page.

techno_race
04-05-2007, 05:10 PM
What language is that? German?

//EDIT:
No, wait, it was French. I was able to get some English out of it here:

http://64.233.179.104/translate_c?hl=en&ie=UTF-8&oe=UTF-8&langpair=fr%7Cen&u=http://isis.no-ip.info/site/&prev=/language_tools

Diana
04-05-2007, 05:18 PM
What language is that? German?

No ! Who are froggies ? :D

Diana
04-05-2007, 05:21 PM
Good very Good, I am french woman :p

Diana
04-08-2007, 11:08 AM
Hello!,

I discovered a problem between my 2 scripts. Scripts with the Lien() function does not run any more!

I read this:



onload

If your HTML page handles the onload event to launch some javascript, it will be overriden by aniMagiX code. So you need to put it back. Ex: your code was:

<body onload="dothis();dothat();">
<!-aniMagiX code by x.singy, xavier@singyfamily.com, http://www.singyfamily.com -->
<link rel="stylesheet" type="text/css" href="http://www.singyfamily.com/Hob/tech/aniMagiX/aniMagiX.css">
<script src=http://www.singyfamily.com/Hob/tech/aniMagiX/gecko/geckos.js></script>
<script src=http://www.singyfamily.com/Hob/tech/aniMagiX/aniMagiX.js></script>

you need to change it into this:

<body>
<!-aniMagiX code by x.singy, xavier@singyfamily.com, http://www.singyfamily.com -->
<link rel="stylesheet" type="text/css" href="http://www.singyfamily.com/Hob/tech/aniMagiX/aniMagiX.css">
<script src=http://www.singyfamily.com/Hob/tech/aniMagiX/gecko/geckos.js></script>
<script src=http://www.singyfamily.com/Hob/tech/aniMagiX/aniMagiX.js></script>
<script>
function start(){
dothis();
dothat();
initAnims();
}
window.onload=start;
</script>




Then I wrote:



<body onload="start();">
<script type="text/javascript">
function start(){
lien();
initAnims();
}
window.onload=start;
</script>
<!-- http://www.singyfamily.com/ -->
<script type="text/javascript" src="javascripts/salamandes/geckos.js"></script>
<script type="text/javascript" src="javascripts/salamandes/aniMagiX.js"></script>


<!-- Script r&#233;alis&#233; par mon tendre et cher ami Alain -->
<script type="text/javascript"> // <![CDATA[
function lien() {
var liens = document.getElementsByTagName("a");
for (var i in liens) { if (liens[i].className == "lien")
liens[i].onclick = function() { window.open(this.href); return false; };
}
}
// ]]>
</script>


But that still does not run!

Link: http://isis.diboo.net

Thank you.

jscheuer1
04-08-2007, 01:38 PM
Start is a reserved word and there should be only one onload:


<body>
<!-- aniMagiX code by x.singy, xavier@singyfamily.com -->
<script type="text/javascript" src="javascripts/salamandes/geckos.js"></script>
<script type="text/javascript" src="javascripts/salamandes/aniMagiX.js"></script>
<!-- Script réalisé par mon tendre et cher ami Alain -->
<script type="text/javascript">
function lien() {
var liens = document.getElementsByTagName("a");
for (var i in liens) { if (liens[i].className == "lien")
liens[i].onclick = function() { window.open(this.href); return false; };
}
}
window.onload=function(){
lien();
initAnims();
}
</script>

There could be other problems.