Discussion:
pop-ups and pvII
(too old to reply)
jpelz
2005-02-26 01:01:48 UTC
Permalink
I've been struggling with creating a very simple pop-up menu using project
seven's extensions. I'm new to dreamweaver so I'm sure I'm missing something
basic...... here's the code for a very basic trigger-popup page, as a test.
After applying Auto Layers and Snap Layers behaviors, following the tutorials
that have been linked here, I get a pop-up menu that moves with the cursor with
roll-over of the trigger image....very strange and confusing. Any help would be
greatly appreciated

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<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_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 P7_autoLayers() { //v1.5 by PVII
var
g,b,k,f,u,k,j,args=P7_autoLayers.arguments,a=parseInt(args[0]);if(isNaN(a))a=0;
if(!document.p7setc){p7c=new Array();document.p7setc=true;for(u=0;u<10;u++){
p7c[u]=new
Array();}}for(k=0;k<p7c[a].length;k++){if((g=MM_findObj(p7c[a][k]))!=null){

b=(document.layers)?g:g.style;b.visibility="hidden";}}for(k=1;k<args.length;k++)
{

if((g=MM_findObj(args[k]))!=null){b=(document.layers)?g:g.style;b.visibility="vi
sible";f=false;
for(j=0;j<p7c[a].length;j++){if(args[k]==p7c[a][j]) {f=true;}}
if(!f){p7c[a][p7c[a].length++]=args[k];}}}
}

function P7_Snap() { //v2.67 by PVII
var
g,x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.argument
s;a=parseInt(a);
if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
da="document.all['"+args[k]+"']";if(document.getElementById){
d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
}else
if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){

p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseIn
t(eval(d+p+".offsetTop"));
}else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
if(tw==0||(navigator.appVersion.indexOf("MSIE
4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){

ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}els
e{

w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.
abs(b)<1000)?0:b;

x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clie
ntY;}}
}else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var
s=0;s<q0.length;s++){

dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');
y+=eval(dd+'.top');

break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b)
;
if(navigator.appVersion.indexOf("MSIE 5")>-1 &&
navigator.appVersion.indexOf("Mac")>-1){

xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
e.left=xx+pa;e.top=yy+pa;}}}
}
//-->
</script>
</head>

<body>
<img src="../smalleye.jpg" name="eyeball" width="76" height="62" id="eyeball"
onMouseOver="P7_autoLayers(0,'Layer1');P7_Snap('eyeball','Layer1',0,0)">
<div id="Layer1" style="position:absolute; width:200px; height:115px;
z-index:1; visibility: hidden;">
<p>aaa</p>
<p>bbb</p>
<p>ccc</p>
</div>
</body>
</html>
Murray *TMM*
2005-02-26 14:14:32 UTC
Permalink
The support forum for PVII methods is here -

news://forums.projectseven.com/pviiwebdev

Did you post there?
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
Post by jpelz
I've been struggling with creating a very simple pop-up menu using project
seven's extensions. I'm new to dreamweaver so I'm sure I'm missing something
basic...... here's the code for a very basic trigger-popup page, as a test.
After applying Auto Layers and Snap Layers behaviors, following the tutorials
that have been linked here, I get a pop-up menu that moves with the cursor with
roll-over of the trigger image....very strange and confusing. Any help would be
greatly appreciated
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<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_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 P7_autoLayers() { //v1.5 by PVII
var
g,b,k,f,u,k,j,args=P7_autoLayers.arguments,a=parseInt(args[0]);if(isNaN(a))a=0;
if(!document.p7setc){p7c=new
Array();document.p7setc=true;for(u=0;u<10;u++){
p7c[u]=new
Array();}}for(k=0;k<p7c[a].length;k++){if((g=MM_findObj(p7c[a][k]))!=null){
b=(document.layers)?g:g.style;b.visibility="hidden";}}for(k=1;k<args.length;k++)
{
if((g=MM_findObj(args[k]))!=null){b=(document.layers)?g:g.style;b.visibility="vi
sible";f=false;
for(j=0;j<p7c[a].length;j++){if(args[k]==p7c[a][j]) {f=true;}}
if(!f){p7c[a][p7c[a].length++]=args[k];}}}
}
function P7_Snap() { //v2.67 by PVII
var
g,x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.argument
s;a=parseInt(a);
if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
da="document.all['"+args[k]+"']";if(document.getElementById){
d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
}else
if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseIn
t(eval(d+p+".offsetTop"));
}else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
if(tw==0||(navigator.appVersion.indexOf("MSIE
4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}els
e{
w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.
abs(b)<1000)?0:b;
x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clie
ntY;}}
}else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var
s=0;s<q0.length;s++){
dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');
y+=eval(dd+'.top');
break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b)
;
if(navigator.appVersion.indexOf("MSIE 5")>-1 &&
navigator.appVersion.indexOf("Mac")>-1){
xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
e.left=xx+pa;e.top=yy+pa;}}}
}
//-->
</script>
</head>
<body>
<img src="../smalleye.jpg" name="eyeball" width="76" height="62" id="eyeball"
onMouseOver="P7_autoLayers(0,'Layer1');P7_Snap('eyeball','Layer1',0,0)">
<div id="Layer1" style="position:absolute; width:200px; height:115px;
z-index:1; visibility: hidden;">
<p>aaa</p>
<p>bbb</p>
<p>ccc</p>
</div>
</body>
</html>
Murray *TMM*
2005-02-26 17:01:04 UTC
Permalink
Well, for certain it's your usage of the extensions that is the problem.
Their troubleshooters are very adept at spotting such usage errors....
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
Not yet. But I will. I first read about the extensions in one of your many
posts on the topic, was convinced to try that method rather than the
built-in
dreamweaver pop-ups. Also I think it may be something very basic I'm
missing,
not having to do with the extension, that's making it behave strangely, so
I
posted here.
jpelz
2005-02-26 16:55:22 UTC
Permalink
Not yet. But I will. I first read about the extensions in one of your many
posts on the topic, was convinced to try that method rather than the built-in
dreamweaver pop-ups. Also I think it may be something very basic I'm missing,
not having to do with the extension, that's making it behave strangely, so I
posted here.
Murray *TMM*
2005-02-26 17:05:40 UTC
Permalink
The forum is an NNTP forum, not a webforum.

I'll see if I can get someone to take a look over here....
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
Thanks for responding, I guess that's what I figured. That's why I posted
my code here hoping for assistance.
jpelz
2005-02-26 17:02:37 UTC
Permalink
I can't seem to find that forum either...
jpelz
2005-02-26 17:04:13 UTC
Permalink
Thanks for responding, I guess that's what I figured. That's why I posted my code here hoping for assistance.
Al Sparber- PVII
2005-02-26 17:24:16 UTC
Permalink
You can't copy and paste code into a forum post. The line-breaks will
corrupt it. Your problem is that you are attempting to snap to an anchor
that is the first-child of the <body>. That is, there is nothing between
the opening body tag and your anchor image. Attached (hopefully) is a
text file containing corrected code.
--
Al Sparber - PVII
http://www.projectseven.com
jpelz
2005-02-26 17:39:16 UTC
Permalink
Thanks very much for your help. Sorry about the code-posting. I appreciate the
help in figuring this out. The extensions are fantastic; as I said above, I
figured I was missing something kind of basic.

Loading...