Javascript popups don't work with Template (Full Version)

All Forums >> [Web Development] >> Microsoft FrontPage Help



Message


yogaboy -> Javascript popups don't work with Template (5/26/2004 9:28:11)

Hello All,

I wrote some HTML with javascript so you click a link and boxes pop up, using layers and hidden/visible functions. Now I've started using FP2003 and I thought I'd make a .dwt template to make my life easier, but every page with the JS popups now doesn't work if I put it in the template.

Any ideas on why?

IAin




Shirley -> RE: Javascript popups don't work with Template (5/26/2004 13:45:33)

The pop ups don't work? or is the link just bad?




yogaboy -> RE: Javascript popups don't work with Template (5/26/2004 19:37:16)

I have the originals and they work, and I've checked them against the new pages using the template and they're the same. The moment I put the code below into the .dwt and create a new page with it, it stops working - the link becomes dead, just the sound of clicking and the grinding of teeth (mine) can be heard[:@].

This is the javascript I use
<script language="JavaScript">
function menus (whichMenu,whatState){
if (!document.all) {document[whichMenu].visibility = whatState;}

if(document.getElementById)
{document.getElementById(whichMenu).style.visibility = whatState}
}//ends function
</script>

Then I use div id's and styles... for example...
<STYLE type="text/css">
#why {position:absolute;top: 60px;left: 0px;width:750px;z-index: 2;visibility:hidden;font-family: century gothic; border:solid #000000 5px;background-color:#ffffff;}
</STYLE>

and in the body a link for the pop-up-box

<div>
<a href="javascript:menus('why','visible')">Why has?...blah blah</a><P>
</div>

and the content for the pop-up-box with a "Close" button
<div id="why">
<H3>Heading</H3><P>
Content<P>
<B><a href="javascript:menus('why','hidden')" class="pjump">Close</a></B>

Am I the only person this has happened to?? Microsoft make me feel so special![:)]
Iain




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125