View Single Post
  #1  
Old 09-18-2007, 12:47 PM
  a1deano's Avatar 
a1deano a1deano is offline
 

X-Adept
  
Join Date: Oct 2004
Posts: 745
 

Default popup information box help please

Hi All

Iam trying to install a mouse over text popup information box, ive followed the instructions but get an error message so not sure if iam doing it right or if this code is compatible with xcart
Instructions are -

Place this code within the head
Quote:
<STYLE TYPE="text/css">
<!--
#dek {POSITION:absolute;VISIBILITY:hidden;Z-INDEX:200;}
//-->
</STYLE>

And place this code within the body -
Quote:
<DIV ID="dek"></DIV>

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

//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=225 BORDER=3 BORDERCOLOR=#FF8C00 CELLPADDING=2 CELLSPACING=4 "+
"BGCOLOR="+bak+"><TD ALIGN=center><FONT COLOR=#000000 SIZE=2>"+msg+"</FONT></TD></TABLE>";
yyy=Yoffset;
if(ns4){skn.document.write(content);skn.document.c lose();skn.visibility="visible"}
if(ns6){document.getElementById("dek").innerHTML=c ontent;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.scrollL eft;
skn.left=x+Xoffset;
var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollT op;
skn.top=y+yyy;
}

function kill(){
yyy=-1000;
if(ns4){skn.visibility="hidden";}
else if (ns6||ie4)
skn.display="none"
}

//-->
</SCRIPT>

Then place this code anywere you want the popup information box -
Quote:
<a href="http://www.yoursite.com" ONMOUSEOVER="popup('Put information here you want to appear in the box.','#D9D9F3')"; ONMOUSEOUT="kill()"><font color="#FF8C00"><u><b>Size Chart</b></u></a>

i keep getting this error message -
Quote:
Error: Smarty error: [in customer/home.tpl line 10]: syntax error: unrecognized tag: POSITION:absolute;VISIBILITY:hidden;Z-INDEX:200; (Smarty_Compiler.class.php, line 436) in /home/a1deano69/public_html/testcart/Smarty-2.6.12/Smarty.class.php on line 1095

not sure if this code needs modifying to work with xcart v4.1.8 and were i should put the information as ive tested it using coffeecup and it works fine, also test in browsers IE and firefox it works fine, just can't get it to work in xcart.

Any help would be greatfully appreciated, regards Dean
__________________
--------------
V4.6.1
xcartmods - Reboot Template

X-cart - X-PDF

Altered Cart - Checkout one
Reply With Quote