Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > JavaScript and CSS

JavaScript and CSS Extensible Markup Language, Java Script, and CSS questions here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 04-03-2008, 08:41 PM
orjan orjan is offline
Learning Programmer
 
Join Date: Sep 2007
Posts: 36
Rep Power: 3
orjan will become famous soon enough
Default Re: Mouseover Popup

in my .css, this is the code:
Code:
#ToolTip{position:absolute; width: 200px; top: 0px; left: 0px; z-index:4; visibility:hidden;}
the javascript is this:

Code:
ContentInfo = "";

topColor = "#808080"
subColor = "#C0C0C0"


var mouse_X;
var mouse_Y;

var tip_active = 0;

function update_tip_pos(){
        document.getElementById('ToolTip').style.left = mouse_X + 20;
        document.getElementById('ToolTip').style.top  = mouse_Y;
}

var ie = document.all?true:false;
if (!ie) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

function getMouseXY(e) {
    if (ie) {
        // grab the x-y pos.s if browser is IE
        mouse_X = event.clientX + document.body.scrollLeft;
        mouse_Y = event.clientY + document.body.scrollTop;
    } else {
        // grab the x-y pos.s if browser is NS
        mouse_X = e.pageX;
        mouse_Y = e.pageY;
    }
    if (mouse_X < 0){mouse_X = 0;}
    if (mouse_Y < 0){mouse_Y = 0;}

    if(tip_active){
        update_tip_pos();
    }
}

function EnterContent(TTitle, TContent){
    ContentInfo = '<table border="0" width="200" cellspacing="0" cellpadding="0">'+
    '<tr><td width="100%" bgcolor="#000000">'+
    '<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
    '<tr><td width="100%" bgcolor='+topColor+'>'+
    '<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
    '<tr><td width="100%">'+
    '<font class="tooltiptitle">&nbsp;'+TTitle+'</font>'+
    '</td></tr></table></td></tr>'+
    '<tr><td width="100%" bgcolor='+subColor+'>'+
    '<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+
    '<tr><td width="100%">'+
    '<font class="tooltipcontent">'+TContent+'</font>'+
    '</td></tr></table></td></tr></table></td></tr></table>';
}

function tip_it(which, TTitle, TContent){
    if(which){
        update_tip_pos();
        tip_active = 1;
        document.getElementById('ToolTip').style.visibility = "visible";
        EnterContent(TTitle, TContent);
        document.getElementById('ToolTip').innerHTML = ContentInfo;
    } else {
        tip_active = 0;
        document.getElementById('ToolTip').style.visibility = "hidden";
    }
}
hope you can help. I haven't had time to learn this coding yet.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 04-03-2008, 08:58 PM
alilg's Avatar   
alilg alilg is offline
Newbie
 
Join Date: Apr 2008
Location: Ultramarine
Age: 21
Posts: 15
Rep Power: 1
alilg is on a distinguished road
Send a message via AIM to alilg Send a message via Yahoo to alilg Send a message via Skype™ to alilg
Default Re: Mouseover Popup

Okay, just replace this function
Code:
function update_tip_pos(){
        document.getElementById('ToolTip').style.left = mouse_X + 20;
        document.getElementById('ToolTip').style.top  = mouse_Y;
}
with this which i wrote
Code:
function update_tip_pos(){
        document.getElementById('ToolTip').style.left = parseInt(parseInt(mouse_X) + 20) +"px";
        document.getElementById('ToolTip').style.top  = mouse_Y + "px";
}
let me know it worked or not!
i tested if with firefox 2 and firefox beta 3
__________________
my free software and games

Last edited by alilg; 04-03-2008 at 09:01 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 04-03-2008, 10:29 PM
orjan orjan is offline
Learning Programmer
 
Join Date: Sep 2007
Posts: 36
Rep Power: 3
orjan will become famous soon enough
Default Re: Mouseover Popup

oh YES! it works!

now I can have multilined tooltips that really works. my users will salute you big time!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 04-04-2008, 12:58 PM
TcM's Avatar   
TcM TcM is offline
Terminator - I'll be back
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 5,709
Rep Power: 47
TcM is a jewel in the roughTcM is a jewel in the roughTcM is a jewel in the rough
Default Re: Mouseover Popup

alilg - Good work! I gave you +rep
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall


Business Directory | Technology Blog | Windows Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nortan Popup Blocker + JavaScript Issue twalters84 JavaScript and CSS 3 03-11-2008 04:47 AM
JavaScript:Tutorial, MouseOver Image Change TcM Javascript 2 10-30-2007 01:51 PM
Popup Ronin JavaScript and CSS 0 02-06-2007 04:08 PM
Mouseover with images dirkfirst HTML Programming 8 12-30-2006 12:48 AM


All times are GMT -5. The time now is 04:05 PM.

Contest Stats

John ........ 87.50000
dargueta ........ 75.00000
Xav ........ 50.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads