If you go to http://www.worldsurfengine.com/Hawaii/home there is a
login function. Once logged in, it allows you to click "account" in
the same place that "login" is and it makes a div slide down from the
menu bar.
Basically, I have firebug installed and it doesn't detect any errors.
I have a cookie installed so that the drop down is persistent. The
problem is, when the account box starts off hidden, it won't drop
down, but it runs all the scripts correectly, because it sets the
cookie to the account box being open. If you refresh, then the box is
open, and if you click close, it closes. Without refreshing the page
if you click account, NOW the drop down will occur, but if you refresh
the page when the box is closed, and try to open it on the new page,
it once again won't open.
Any thoughts?
Here is an excerpt of the code i'm using:
The Javascript Functions Code:
<script type="text/javascript">
function toggleAccount() {
obj = document.getElementById('accounttext');
if (obj.innerHTML == "Account") {
Effect.SlideDown('accountinfodiv');
obj.innerHTML = "Close";
$('menu').style.borderBottomColor = "transparent";
$('menu').style.borderBottomWidth = "0px";
new Ajax.Request('../includes/setCookie.php', {parameters:
'setcook=open'});
}
else {
Effect.SlideUp('accountinfodiv')
obj.innerHTML = "Account";
setTimeout('$("menu").style.borderBottomWidth = "thin"; $
("menu").style.borderBottomColor = "#000000";', 1000);
new Ajax.Request('../includes/setCookie.php', {parameters:
'setcook=closed'});
}
}
</script>
HTML Menu Bar (You If you look under $authenticated) you'll find the
onclick-"toggleAccount()":
<{if not $authenticated }>
<div style="float: right;"><a href="#" title="Login"
onclick="Modalbox.show('../public/loginfunctions.php', {title:
this.title, width: '650', height: '400', method: 'post', params:
'submit=Login%20Form&method=Login'}); return false;">Login</a> <img
style="vertical-align: middle;" src="/images/bluesurf/seperator.gif" /
> <a href="#" title="Login" onclick="Modalbox.show('../public/
loginfunctions.php', {title: this.title, width: '650', height: '400',
method: 'post', params: 'submit=Login%20Form&method=Register'});
return false;">Register</a></div>
<{/if}>
<{if $authenticated }>
<div style="float: right;"><a href="#" id="accounttext"
onclick="toggleAccount(); return false;">Account</a> <img
style="vertical-align: middle;" src="/images/bluesurf/seperator.gif" /
> <a href="#" title="Logout" onclick="Modalbox.show('/public/
loginfunctions.php', {title: this.title, width: 600, height: 400,
method: 'post', params: 'submit=Logout'}); return false;">Logout</a></
div>
<{/if}><br />
Any thoughts?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---