Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem showing OnMouseOver PopUp at right mouse position.

Problem showing OnMouseOver PopUp at right mouse position.

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rahul Chitte
    wrote on last edited by
    #1

    Hi, I need help regarding displaying small popup message when user mouse over the pointer the hyperlink, I have created this with javascript and it is showing the required popup onmouseover and onMouseOut it is hiding the popup using kill() method given below in code snippest but problem is whenever u scroll the page the popup msg will get displayed at the top and not on the hyperlink(onMouseOver).. If anyone is having any idea of setting the mouse pointer to desired location or any alternate solution to show onHover popup using javascript. Plz see code below:       //Hover Text for SSN Xoffset= 20 //-10; //-60;      // modify these values to ... Yoffset= -25 //-150; //20;      // change the popup position.          var old,skn,iex=(document.all),yyy=-1000; var ns4=document.layers var ns6=document.getElementById&&!document.all var ie4=document.all if (ns4) skn=document.dek else if (ns6) skn=document.getElementById("dek").style else if (ie4) skn=document.all.dek.style if(ns4)document.captureEvents(Event.MOUSEMOVE); else {       skn.visibility="visible"       skn.display="none" } document.onmousemove=get_mouse; function popup(msg,bak) {       var content="<TABLE   WIDTH=250 BORDER=1 BORDERCOLOR=#01244E CELLPADDING=2 CELLSPACING=0 "+       "BGCOLOR="+bak+"><TD ALIGN=left style='padding-left:5px;font-size:8pt;font-family:Arial;color:#01244E'>"+msg+"</TD></TABLE>";       yyy=Yoffset;       if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}       if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}       if(ie4){document.all("dek").innerHTML=content;skn.display=''} } function get_mouse(e) {       var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;       skn.left=x+Xoffset;       var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;       skn.top=y+yyy;       } function kill() {       yyy=-1000;       if(ns4){skn.visibility="hidden";}       else if (ns6||ie4)       skn.display="none" }

    C 1 Reply Last reply
    0
    • R Rahul Chitte

      Hi, I need help regarding displaying small popup message when user mouse over the pointer the hyperlink, I have created this with javascript and it is showing the required popup onmouseover and onMouseOut it is hiding the popup using kill() method given below in code snippest but problem is whenever u scroll the page the popup msg will get displayed at the top and not on the hyperlink(onMouseOver).. If anyone is having any idea of setting the mouse pointer to desired location or any alternate solution to show onHover popup using javascript. Plz see code below:       //Hover Text for SSN Xoffset= 20 //-10; //-60;      // modify these values to ... Yoffset= -25 //-150; //20;      // change the popup position.          var old,skn,iex=(document.all),yyy=-1000; var ns4=document.layers var ns6=document.getElementById&&!document.all var ie4=document.all if (ns4) skn=document.dek else if (ns6) skn=document.getElementById("dek").style else if (ie4) skn=document.all.dek.style if(ns4)document.captureEvents(Event.MOUSEMOVE); else {       skn.visibility="visible"       skn.display="none" } document.onmousemove=get_mouse; function popup(msg,bak) {       var content="<TABLE   WIDTH=250 BORDER=1 BORDERCOLOR=#01244E CELLPADDING=2 CELLSPACING=0 "+       "BGCOLOR="+bak+"><TD ALIGN=left style='padding-left:5px;font-size:8pt;font-family:Arial;color:#01244E'>"+msg+"</TD></TABLE>";       yyy=Yoffset;       if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}       if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}       if(ie4){document.all("dek").innerHTML=content;skn.display=''} } function get_mouse(e) {       var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;       skn.left=x+Xoffset;       var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;       skn.top=y+yyy;       } function kill() {       yyy=-1000;       if(ns4){skn.visibility="hidden";}       else if (ns6||ie4)       skn.display="none" }

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      My first google hit for javascript scroll position gave me this: To save the last scroll positions (horizontal and vertical): var hscroll = (document.all ? document.scrollLeft : window.pageXOffset); var vscroll = (document.all ? document.scrollTop : window.pageYOffset); then when you swap in the new form just scroll to those positions: window.scrollTo(hscroll, vscroll); So, you need to use the values being used in this code, to offset your menu by the scrollbar position.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups