Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 11th, 2006, 12:18 PM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
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.
Reply With Quote
  #2 (permalink)  
Old December 18th, 2006, 01:24 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 481
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:30 AM.


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