Flash Games

 FAQ   Search   Members   Groups   User Control Panel      Login 

It is currently Thu Jan 08, 2009 2:57 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: slide in menu
PostPosted: Fri Aug 15, 2008 12:03 am 
Offline

Joined: Thu Aug 14, 2008 11:33 pm
Posts: 3
:?: I am in need of assistance. I have generated a script for a slide in menu and on its own it works alright. However when I try to set it up for multiple slide menus in the same webpage I run in to some issues. Primarily the script only working for one slide on both tabs. So tab 1 hides and and un hides menu and tab 2 does the same thing. Any Ideas???Also when the page loads i need the menu to be closed below I have included the base script Im using any help would be great...thank you


<HTML>
<head>
<style>
#tabdiv { z-index: 2; left: 220px; position: absolute; top: 210px
}
#textdiv { z-index: 1; padding-top: 10px; position: absolute; top: 200px;
border-top-width: 1px; padding-right: 5px; padding-left: 5px;
border-left-width: 1px; border-left-color: #000099; left: 0px;
border-bottom-width: 1px; border-bottom-color: #000099;
padding-bottom: 10px; width: 220px; color: black; border-top-color:GREEN;
background-color:GREEN; border-right-width: 1px; border-right-color:GREEN
}
</style>
<SCRIPT language=JavaScript1.2>
if (document.layers) {n=1;ie=0}
if (document.all) {n=0;ie=1}
function init() {
if (n) tab = document.tabDiv
if (n) poptext = document.textdiv
if (ie) tab = tabDiv.style
if (ie) poptext = textdiv.style
}
var tabShow=1;
function myfunction() {
if (tabShow == 1) {
if (n) {
tab.visibility = "hide";
tab.left = 0;
tab.visibility = "show";
poptext.visibility = "hide";
tabShow = 0;
return;
}
if (ie) {
tab.visibility = "hidden";
tab.left = 0;
tab.visibility = "visible";
poptext.visibility = "hidden";
tabShow = 0;
return;
}
}
if (tabShow == 0) {
if (n) {
tab.visibility = "hide";
tab.left = 220;
tab.visibility = "show";
poptext.visibility = "show";
tabShow = 1;
}
if (ie) {
tab.visibility = "hidden";
tab.left = 220;
tab.visibility = "visible";
poptext.visibility = "visible";
tabShow = 1;
}
}
}
</SCRIPT>
</head>


<body onload=init()>
<!-- Slide-in table start -->
<DIV id=tabDiv><B>IRA</B><a href="javascript:myfunction();">
<IMG alt="Click here to close" src="images/popout_menu.gif" width=14 border=0></a></DIV>
<DIV id=textdiv>
<font face="Verdana" size="2"><B>INDIVIDUAL RETIREMENT ACCOUNT</B></font><br>
<font face="Verdana" size="1">IRA is held at a custodian institution such as a bank or brokerage, and may be invested in anything that the custodian allows (for instance, a bank may allow certificates of deposit, and a brokerage may allow stocks and mutual funds). Unlike the Roth IRA, the only criterion for being eligible to contribute to a Traditional IRA is sufficient income to make the contribution.Transactions in the account, including interest, dividends, and capital gains, are not subject to tax while still in the account, but upon withdrawal from the account, withdrawals are subject to federal income tax.
</font><br>
</DIV>
<!-- Slide-in table end -->
</body>
</HTML>
</HTML>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 15, 2008 2:27 am 
Offline
500+ Club
User avatar

Joined: Wed Feb 27, 2008 6:14 am
Posts: 778
Location: Cebu City Philippines
Your script is an old script. Which still consider for IE5- browsers.

What's your goal? Is it just to show/hide div?

_________________
Please don't PM me, let's keep the discussion on the public board.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 15, 2008 3:01 am 
Offline

Joined: Thu Aug 14, 2008 11:33 pm
Posts: 3
rangana wrote:
Your script is an old script. Which still consider for IE5- browsers.

What's your goal? Is it just to show/hide div?
yes. i have limited space but wanted to have it some what interactive.... and this particular code provides the kind of effect im lookin for i just need it for multiple tables....

----DOC


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 15, 2008 3:13 am 
Offline
500+ Club
User avatar

Joined: Wed Feb 27, 2008 6:14 am
Posts: 778
Location: Cebu City Philippines
Change the script to this one instead:
Code:
<script type="text/javascript">
function myfunction(targetDiv){
var el=document.getElementById(targetDiv);
el.style.display=(el.style.display!='none')?'none':'';
}
</script>


This will let your work with multiple divs. You just need to use myfunction and the targetDiv.

Hope that helps.

_________________
Please don't PM me, let's keep the discussion on the public board.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 15, 2008 3:23 am 
Offline

Joined: Thu Aug 14, 2008 11:33 pm
Posts: 3
rangana wrote:
Change the script to this one instead:
Code:
<script type="text/javascript">
function myfunction(targetDiv){
var el=document.getElementById(targetDiv);
el.style.display=(el.style.display!='none')?'none':'';
}
</script>


This will let your work with multiple divs. You just need to use myfunction and the targetDiv.

Hope that helps.
ok cool will have to define the different divs ie...div1 div2....


----DOC


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 15, 2008 3:35 am 
Offline
500+ Club
User avatar

Joined: Wed Feb 27, 2008 6:14 am
Posts: 778
Location: Cebu City Philippines
Yes. You can always call myfunction multiple times in a page.

Hope that helps.

_________________
Please don't PM me, let's keep the discussion on the public board.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review

Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User:
Pass:
Log me on automatically each visit: