PDA

View Full Version : Problem with FF and "Cursor Trailer Text"



yvesm
04-03-2005, 09:03 AM
The "Cursor Trailer Text" script does not work with Firefox. It works with IE.
Is there any modification to works with IE AND FF ??
Yves

jscheuer1
04-03-2005, 04:32 PM
For Cursor Trail Text All (http://www.dynamicdrive.com/dynamicindex13/trailortext.htm) just substitute this for the main script:
<script>

/*
Cursor Trailor Text- By Peter Gehrig (http://www.24fun.ch/)
Permission given to Dynamicdrive.com to feature script in it's archive.
For full source code, installation instructions, and 1000's more DHTML scripts,
visit http://dynamicdrive.com
Modified in Dynamic Drive Help Forums by jscheuer1 to work in NS6+ & FF1+
*/

var x,y
var step=20
var flag=0

// Your snappy message. Important: the space at the end of the sentence!!!
var message="DYNAMIC DRIVE! "
message=message.split("")

var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos[i]=-50
}

var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-50
}

function handlerMM(e){
if ((document.getElementById)&&(!document.all)){
x = e.pageX
y = e.pageY
flag=1
}
else{
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}
}

function makesnake() {
if ((flag==1 && document.all)||(flag==1 && document.getElementById)) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y

for (i=0; i<message.length-1; i++) {
if ((document.getElementById)&&(!document.all)){
var thisspan = eval("document.getElementById('span"+(i)+"').style")
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
else{
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
}
}

else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y

for (i=0; i<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
var timer=setTimeout("makesnake()",30)
}

</script>Overflow Handling is shot (scrollbars act oddly but, not so badly) in FF & NS6+, otherwise, works fine.

yvesm
04-03-2005, 05:06 PM
Many thanks, now works fine in IE and FF....
Thanks again
Yves

yvesm
04-05-2005, 03:41 PM
Hello jscheuer1,
Many thanks again for the correction, but ... i found that in FF (no pb in IE), if the mouse pointer is going to the right of the screen, the screen width is expanded and the Horizontal scrollbar enables to go to the right.
Is there a possibility to suppress this effect ??
Thanks
Yves

jscheuer1
04-05-2005, 04:18 PM
Overflow Handling is shot (scrollbars act oddly but, not so badly) in FF & NS6+, otherwise, works fine.I already alerted you to this, the problem is that these Mozilla based browsers do not support the handling of overflow of content the way IE does (through a simple style declaration). It is probably possible to write a routine that will temporarily suspend the effect if the mouse gets too close to the right in those browsers. I don't have time for that right now as I am in the middle of several paid projects. I or someone will get to it sooner or later. Please be aware, I am not affiliated with DD. Frankly, I don't see it as a huge problem. And, you are most welcome for the modifications.

yvesm
04-05-2005, 09:19 PM
Hello,
I did not take attention to your alert, sorry. It is not a show stopper.... i will monitor the subject until someone find a correction.
Anyway, many thanks for your help.
Regards
Yves

jscheuer1
04-06-2005, 01:34 AM
OK, so I played hooky from work and got bored, I've got it about as fixed as can be. Change the body tag to:
<body onLoad="makesnake()" style="width:99%!important;width:100%;height:98%!important;height:'';overflow-x:hidden;overflow-y:scroll"> and in the script, right after:
if ((document.getElementById)&&(!document.all)){
var thisspan = eval("document.getElementById('span"+(i)+"').style")stick this in:
if (window.innerWidth){
if (xpos[i]>window.innerWidth-30)
thisspan.display='none'
else
thisspan.display='block'
}I had fun, enjoy!

yvesm
04-06-2005, 09:18 AM
Many thanks jscheuer1,
for this so fast correction. This correct completly the problem, but the background image is not displayed on the full screen (especialy in 800x600). So leaving the old <body onLoad="makesnak.... with your correction in the function makesnake(), everything is working well (except the small horizontal scrollbar, but as the screen is no more expanding, it is not a problem).
Many thanks again for your fast action.
Regards
Yves

jscheuer1
04-06-2005, 03:57 PM
I can't duplicate the background image thing. I tried applying a background image as style and using the body tag's 'background=' attribute. Neither one caused a problem. Are you using a different method for your background image?

yvesm
04-06-2005, 05:33 PM
Yes in 800x600, the background image is truncated on the right, in 1024x768, the truncation is not so important.
I use a css file (bgfixe.css) containing:
.bgfixe { background-attachment: fixed; background-color: #FFFFFF; background-image: url(fondbleu.gif)}
Note that fondbleu.gif is 128x128px
and the class="bgfixe" is added at the end of the
<body onLoad="makesnake()" style=".....class="bgfixe">
Thanks for your help, but this is not important...
(Excuse my english, but i am french....from the south of France)
Regards
Yves

jscheuer1
04-08-2005, 01:37 AM
Using your code I tried duplicating the effect you observed but could not. Is your page inside a frames page or an iframe? If not, I'd love to see the page, could you supply a link?