1
   

Image mouse trail script problem

 
 
niz
 
Reply Mon 6 Dec, 2004 05:00 am
Hi,
My mouse trail disappears behind a flash banner and a menu item on my page. It is visible otherwise on the rest of the page. Changing the z-index parameter to a higher value doesnt seem to help. Can somebody please help me on this? Thanks. Niz
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 625 • Replies: 5
No top replies

 
Craven de Kere
 
  1  
Reply Mon 6 Dec, 2004 08:29 pm
I am not sure what script you are talking about but I don't think it can be changed to do what you want.

Maybe you can put the flash in an IFRAME.
0 Replies
 
niz
 
  1  
Reply Tue 7 Dec, 2004 12:16 am
Image mouse trail script problem
Craven de Kere wrote:
I am not sure what script you are talking about but I don't think it can be changed to do what you want.

Maybe you can put the flash in an IFRAME.


Thanks Craven. Am posting the code i have used.

<script type="text/javascript">

var trailimage=["trail.jpg", 80, 37]
var offsetfrommouse=[10,-20]
var displayduration=0

if (document.getElementById || document.all)
document.write('<div id="trailimageid" style="position:absolute;visibility:visible;left:0px;top:0px;width:1px;height:1px"><img src="'+trailimage[0]+'" border="0" width="'+trailimage[1]+'px" height="'+trailimage[2]+'px"></div>')

function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail(){
gettrailobj().visibility="hidden"
document.onmousemove=""

}

function followmouse(e){
var xcoord=offsetfrommouse[0]
var ycoord=offsetfrommouse[1]
if (typeof e != "undefined"){
xcoord+=e.pageX
ycoord+=e.pageY
}
else if (typeof window.event !="undefined"){
xcoord+=truebody().scrollLeft+event.clientX
ycoord+=truebody().scrollTop+event.clientY
}
var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
if (xcoord+trailimage[1]+3>docwidth || ycoord+trailimage[2]> docheight)
gettrailobj().display="none"
else
gettrailobj().display=""
gettrailobj().left=xcoord+"px"
gettrailobj().top=ycoord+"px"
}

document.onmousemove=followmouse

if (displayduration>0)
setTimeout("hidetrail()", displayduration*1000)

</script>
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 7 Dec, 2004 12:20 am
I don't think what you want is possible.
0 Replies
 
Monger
 
  1  
Reply Tue 7 Dec, 2004 08:17 am
This is somethiong I've had to do before for a dhtml menu...

You can make the Flash's background transparent using the WMODE property, which also makes it behave more like an HTML layer. To do so you'd add the following parameter within your OBJECT tag:

Code:<param name="wmode" value="transparent" />

...Then apply it to your EMBED tag:
Code:wmode="transparent"


And then just wrap your Flash OBJECT in a DIV with a lower z-index than the layer with your mouse-trailing DHTML effect. I've tested it with your above code & it works great.

See here for more info: Macromedia.com: How to make a Flash movie with a transparent background

BTW, replacing both instances of "transparent" with "opaque" should also produce the effect you're after (& I'm only guessing here but it might make performance take a slightly smaller hit), but Macromedia recommends the method I've shown above.
0 Replies
 
niz
 
  1  
Reply Sun 12 Dec, 2004 10:49 pm
Thanks Monger. You made my day! It works!!! :-))))
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » Image mouse trail script problem
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 01/17/2025 at 10:56:38