slideUp() not working in a drop down menu

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
drayarms
Forum Contributor
Posts: 134
Joined: Fri Dec 31, 2010 5:11 pm

slideUp() not working in a drop down menu

Post by drayarms »

Hello, I guess the topic adequately describes the problem. I'm just going to go right ahead and include the html, css and js of the elements concerned. Basically, I can't get the slideUp() method to bring the #pic_options_div element into view, but show() and fadeIn() work just fine. What could be the problem?


html

Code: Select all

				
				
<ul id = "pic_options_panel">

	<li  class = "comment_color pic_options">Picture Options

		<ul id = "pic_options_div">

			<li id = "pic_options_collapse"> collapse </li>

			<li align = "center">Make Main Picture</li>

			<li align = "center">Delete This Picture </li>

			<li id = "upload_pic_link" align = "center">Upload New Picture </li>

		</ul>

	</li>
	


	<li class = "comment_color pic_comments">Comments</li>


	<li class = "clear"> </li>
	

</ul>



css

Code: Select all

#pic_options_panel{z-index:601;margin:auto;padding:0px;position:relative;top:-80px;width:98%;height:30px;border:none;overflow:none;}

.pic_comments{float:left;position:relative;top:0px;left:80px;width:135px;cursor:pointer;}

.pic_options{float:left;position:relative;top:0px;left:40px;width:135px;cursor:pointer}

.pic_options ul{display:none;z-index:650;margin:0px;padding:0px;position:relative;bottom:110px;min-height:0px;width:142px;border:1px solid #ccc}

js

Code: Select all

$(document).ready(function() {

	$(".pic_options").click(function() {


		$(this).children().slideUp(700);

         });

});
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: slideUp() not working in a drop down menu

Post by pickle »

It's not obvious from the function names, but slideUp() is a hiding function. slideDown() is the showing function.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Gopesh
Forum Contributor
Posts: 143
Joined: Fri Dec 24, 2010 12:48 am
Location: India

Re: slideUp() not working in a drop down menu

Post by Gopesh »

Hi,Can u create a Jsfiddle to display ur pblm?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: slideUp() not working in a drop down menu

Post by pickle »

Gopesh wrote:Hi,Can u create a Jsfiddle to display ur pblm?
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply