Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2006, 12:18 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default onmousemove flicker

Hello,

I'm trying to get an image to follow the cursor whenever the onmousemove event is triggered inside an image (using an image map for mouse move coords).

This is the image markup:

<map name = "popMap">
<area nohref shape = "poly" coords = "619,190, 698,191, 691,211 625,212, 61 9,190" onmousemove = "revPopUp()" onmouseout = "hidePopUp()">
</map>

<img id ="callout" src = "callout.gif" style = "visibility:hidden; position:absolute; border:none; z-index:1;">

<img usemap = "#popMap" src = "console start.gif" style = "border:none">

If I try and assign a negative value to the event.clientX/Y in my script (to follow), I get a nasty intermittent flicker from the revealed image. But if I don't assign a negative value, the image doesn't flicker at all. The only problem is that the image is over the other side of the page if I don't use a negative value. Here's the script:

<script language = "javascript">
    var popUp = document.getElementById("callout")

        function revPopUp()

        var eCx = event.clientX -200
        var eCy = event.clientY -240
        {
        popUp.style.visibility = "visible"

        popUp.style.pixelLeft = eCx
        popUp.style.pixelTop = eCy
        }

        function hidePopUp()
        {
        popUp.style.visibility = "hidden"
        }
</script>

Is this something I can conquer in my HTML markup? Or is there a bug here? Im coding for IE6 SP1 on NT4.

Thanks in advance
Joe


'sync' <cr>
The name specified is not recognized as an internal or external command, operable program or batch file.
__________________
\'sync\' &lt;cr&gt;
The name specified is not recognized as an internal or external command, operable program or batch file.
 
Old December 18th, 2006, 01:24 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hai,
you made a mistake, use the javascript like this
<script language = "javascript">

        function revPopUp()
         {
        var popUp = document.getElementById("callout")
        var eCx = event.clientX -200
        var eCy = event.clientY -240

        popUp.style.visibility = "visible"

        popUp.style.pixelLeft = eCx
        popUp.style.pixelTop = eCy
        }

        function hidePopUp()
        {
        popUp.style.visibility = "hidden"
        }
</script>

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
IE6 Image Flicker - despite fix mediamole CSS Cascading Style Sheets 0 March 8th, 2008 08:49 AM
Flicker Problem goyduyudu General .NET 0 March 8th, 2007 10:44 AM
Screen Flicker SerranoG Access 1 May 16th, 2004 03:15 PM
DataList Control causes screen flicker Jan_Ma Classic ASP Components 0 June 30th, 2003 04:33 PM
SmartNavigation and Screen Flicker Jan_Ma ASP.NET 1.0 and 1.1 Basics 0 June 28th, 2003 08:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.