0

Here is the script I'm using:

$(function () {
	$('#nav a[title=toggle]').click(function() {
		$('#user').slideToggle();

	});
});

However, when I click the Toggle link located on the nav bar, it slides the #user up, and immediately slides #user back down.

Here's the CSS for #user:

#user {
	z-index:1;
	position:fixed;
	left:0px;
	width: 100%;
	margin-top: -40px;
	padding-top: 50px;
	height: 40px;
	background:#09F;
	color:#FFF;
	font-weight: bold;
	-webkit-border-radius: 10px;
}
3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by ZethSchlenker
0

inside head metas --- jquery code
then outside head metas, inside body metas ----- your scripts code

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Random-Happens | Contact</title>
<link href="random-happens_files/styles.css" rel="stylesheet" type="text/css">
<script src="random-happens_files/jquery-1.js" type="text/javascript"></script>
</head><body>
<center>
<div id="container">
<div style="display: block;" id="user">

<script src="random-happens_files/scripts.js" type="text/javascript"></script>
0

Ah, I found the error. Even though your suggestion wasn't the right one (to fix the error that is), it made me look in a file I forgot about. Turns out I was calling the script twice, which was making it toggle the #user twice. Thank you very much! :D

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.