?
Solved

HOW TO USE THE FOLLOWING CODE PLEASE?

Posted on 2003-03-21
14
Medium Priority
?
136 Views
Last Modified: 2008-03-10
hi.iam not well versed in coding as iam basically a graphic designer

i need to use a tool tip in my code...i dont know how to put the code..

this is my CODE  
****
<div id="Layer3" style="position:absolute; left:363px; top:32px; width:40px; height:29px; z-index:204"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','BOT_B.gif',1)"><img src="BOT_S.gif" name="Image3" width="31" height="21" border="0"></a></div>
********
AND I WANT TO ADD THE FOLLOWING CODE IN THE MOUSE OVER AND MOUSE OUT PLACES.of my ABOVE CODE AND I DONT KNOW HOW TO INCLUDE THIS

*******
<a href="http://wsabstract.com" ONMOUSEOVER="popup('Website Abstraction, the definitive JavaScript site on the net.','lightgreen')"; ONMOUSEOUT="kill()">)"><img src="BOT_S.gif" name="Image3" width="31" height="21" border="0"></a>
******

so that when i put the mouse over..i can see the popup....

can u help me out..
thanks
venky



0
Comment
Question by:ramvenkat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 3

Expert Comment

by:vosk
ID: 8179980
Is that?
<html>
<head>
</head>
<body>
<div id="Layer3" style="position:absolute;left:363px;top:32px;width:40px;height:29px;z-index:204">
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','BOT_B.gif',1)">
<img src="BOT_S.gif" name="Image3" width="31" height="21" border="0">
</a>
<a href="http://wsabstract.com" ONMOUSEOVER="popup('Website Abstraction, the definitive JavaScript site on the net.','lightgreen')"; ONMOUSEOUT="kill()">)">
<img src="BOT_S.gif" name="Image3" width="31" height="21" border="0">
</a>
</div>
</body>
</html>
I really don't undertand your question.
jbosch(vosk)
0
 

Expert Comment

by:sbdidine
ID: 8179997
you can try to add kill(); at the end of MM_swapImgRestore() function and popup('Website Abstraction, the definitive JavaScript site on the net.','lightgreen') at the end of MM_swapImage('','','').
0
 
LVL 10

Expert Comment

by:daleoran
ID: 8180003
Hi there,
try

<div id="Layer3" style="position:absolute; left:363px; top:32px; width:40px; height:29px; z-index:204"><a href="http://wsabstract.com" ONMOUSEOVER="popup('Website Abstraction, the definitive JavaScript site on the net.','lightgreen')"; ONMOUSEOUT="kill()"><img src="BOT_S.gif" name="Image3" width="31" height="21" border="0" alt="Put tool tip text here"></a>
</div>

the alt tag is the tool tip so put your text in the quotes after it.

Hope this helps

Michael

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ramvenkat
ID: 8180100
thanks for your REPLIES..
ok let me tell u..what i need really

this is my final code
***********
<div id="Layer2" style="position:absolute; left:155px; top:23px; width:32px; height:20px; z-index:202"><a href="http://wsabstract.com"  onMouseOver="popup('UNDER CONS','lightgreen')" MM_swapImage('Image2','','india_b.gif',1)"   onMouseOut="kill()" "MM_swapImgRestore()" ><img src="india_s.gif" name="Image2" width="31" height="21" border="0"></a></div>
*****

NOW THE 1)TOOL TIP WORKS PERFECT
2)BUT THE IMAGE IS NOT CHANGING WHEN THE MOUSE OVER IT..

BUT WHEN I CHANGE THE CODE LIKE THIS...

<div id="Layer2" style="position:absolute; left:155px; top:23px; width:32px; height:20px; z-index:202"><a href="http://wsabstract.com"  onMouseOver=MM_swapImage('Image2','','india_b.gif',1) "popup('UNDER CONS','lightgreen')"    onMouseOut="MM_swapImgRestore()" "kill()"  ><img src="india_s.gif" name="Image2" width="31" height="21" border="0"></a></div>

BUT NOW..THE MOUSE OVER FUNCTION IS WORKING
BUT THE TOOL TIP IS NOT COMING..

i will paste the full code here for your refernce

*******
<html>
<head>
<title>BEST TOOL TIP CHECK</title>
<STYLE TYPE="text/css">
<!--
#dek {POSITION:absolute;VISIBILITY:hidden;Z-INDEX:200;}
//-->
</STYLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onLoad="MM_preloadImages('BOT_B.gif')">
<DIV ID="dek"></DIV>





<SCRIPT TYPE="text/javascript">
<!--

//Pop up information box II (Mike McGrath (mike_mcgrath@lineone.net,  http://website.lineone.net/~mike_mcgrath))
//Permission granted to Dynamicdrive.com to include script in archive
//For this and 100's more DHTML scripts, visit http://dynamicdrive.com

Xoffset=-60;    // modify these values to ...
Yoffset= 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=150 BORDER=1 BORDERCOLOR=black CELLPADDING=2 CELLSPACING=0 "+
"BGCOLOR="+bak+"><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></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"
}

//-->
</SCRIPT>
<div id="Layer2" style="position:absolute; left:155px; top:23px; width:32px; height:20px; z-index:202"><a href="http://wsabstract.com"  onMouseOver=MM_swapImage('Image2','','india_b.gif',1) "popup('UNDER CONS','lightgreen')"    onMouseOut="MM_swapImgRestore()" "kill()"  ><img src="india_s.gif" name="Image2" width="31" height="21" border="0"></a></div>



</body>
</html>


i hope i will get a solution soon
thanks
venky
0
 
LVL 2

Accepted Solution

by:
IeuanJ earned 200 total points
ID: 8180486
OK heres what your doing wrong.

The onMouseOver event is written like this


onMouseOver = "event()"

For more than one event you must do the following

onMouseOver = "event1(); event2();"

you were doing

onMouseOver = "event1()" "event2()"


You see when you use the second " as far as the browser is concerned that is the end of your onMouseOver code, emaning that only the first event you specified was working.  Try the code below and you should get both effects.



<div id="Layer2" style="position:absolute; left:155px; top:23px; width:32px; height:20px; z-index:202"><a href="http://wsabstract.com"  onMouseOver="MM_swapImage('Image2','','india_b.gif',1);popup('UNDER CONS','lightgreen');"   onMouseOut="MM_swapImgRestore();kill();" ><img src="india_s.gif" name="Image2" width="31" height="21" border="0"></a></div>
0
 

Author Comment

by:ramvenkat
ID: 8180525
THAN YOU SO MUCH IeuanJ
its working perfect...u see.thats y they say expertexchange is the place to get help from great minds!!

thanks so much guys..
and i have one more doubt...now i.e

IN THE THIS CODE...alt="Botswana Home Page" it gives us a defaulth tool tip..is there is any possibility to change teh default color of the bg and text of this ALT tooltip..
thank
venky
0
 
LVL 2

Expert Comment

by:IeuanJ
ID: 8180556
Unfortunately I dont think so, I think it conforms to the standard windows colour/font.

And really it's not great minds just made all the mistakes before myself. :)
0
 

Author Comment

by:ramvenkat
ID: 8180573
thanks for your quick response..
0
 
LVL 2

Expert Comment

by:IeuanJ
ID: 8180610
Your welcome, just out of interest I notice you havent closed any questions yet, some of them have already been answered might be an idea for you to close them out.
0
 

Author Comment

by:ramvenkat
ID: 8180626
hey john.. how to close the question..
0
 
LVL 2

Expert Comment

by:IeuanJ
ID: 8180642
See next to someones name when they post a comment there is an accept answer link ?  just use that to accept the most useful answer to your question.
0
 

Author Comment

by:ramvenkat
ID: 8180662
ok..i have done that for your detailed answer to my probs
thanks once again..
do u have any idea of how to include our company's icon in the address bar of the browser? as i see some sites do and i dont know how to it for my company sites..any solution u have john

venky
0
 
LVL 5

Expert Comment

by:gator4life
ID: 8187829
ramvenkat -

I noticed in your profile that you have asked many questions, have received solutions for all of them, and have not closed any of them out.  Please begin closing out your questions and awarding points to the experts for their time.  Remember, the experts here are volunteers that are helping you out of their unselfish desire to help others.  The only way that the experts get rewarded is through the awarding of points, and you are disrespecting the experts by not closing out your questions and acknowledging that they helped you.  As much as you compliment the experts for their help, it seems very odd that you do not show your appreciation for their help.  If you do not begin closing out your questions or do not close out your current questions, I will report your account to an EE administrator for immediate removal.

Also, your current question has been answered in this thread.  If you have another question, please open a new question, instead of asking as many questions as you can in one thread without increasing the number of points.

gator4life
(chomp, chomp)
0
 
LVL 2

Expert Comment

by:IeuanJ
ID: 8216461
Do a search on favicon should get you the info you want.

Cheers for closing out all your questions by the way.  Experts-Exchange relies on this to work.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question