i'm looking into implementing something similar to the li's in chrome extension page. Should i use jQuery slideToggle? maybe someone can provide some sort of a sample code i could start off with? (i'm new to jQuery)
Asked
Active
Viewed 249 times
0
-
Please edit you question to make it more understandable – Starx Mar 27 '12 at 16:03
-
Tom look at my answer to see how to mimic that action. – aziz punjani Mar 27 '12 at 16:25
4 Answers
0
Check out this post: jQuery & CSS - Remove/Add display:none
I think that it should work for hiding/showing.
0
Its extremely hard to answer your question. But showing and hiding a div is very easy, just use .toggle()
$("#mydiv").toggle();

Starx
- 77,474
- 47
- 185
- 261
0
You can try Jquery UI Accordion rather than inventing your own wheel. These link might help you.
-
-
When I do need something I do little bit of googling first. I don't waste my time creating my own plugins when there are a lot of good plugins that has sophisticated features & BTW using plugins is not hard and complicated than writing your own code to mimic it. – jems Mar 27 '12 at 16:31
-
It's not complicated, it's rather easy. Complicated for someone who can't code, in that case, go ahead and include thousands of lines of code you don't really need. Your choice. Btw that plugin doesn't even really do what this post wants it to do. I'm not against plugins, just against the idea of not being able to think for yourself and realizing when something is simple and doesn't reaquire a bloated plugin. I did it in 8 lines, how many lines of code does that plugin you suggested have in it ? – aziz punjani Mar 27 '12 at 16:45
0
You don't need any complicated plugins, you can do all of this with jquery. Here is a quick sample i whipped out. It's simple really.
The html
<div id="outer">
<p>Some outer content </p>
<div id="inner">Slider Content </div>
</div>
The css
#outer{
height: 200px;
width: 200px;
background-color: brown;
overflow: hidden;
position: relative;
}
#inner{
height: 200px;
width: 100%;
background-color: green;
position: absolute;
top: 100%;
}
The JS
$('#outer').hover(
function(){
$('#inner').animate({ top: '0%' }, 'easein' );
},
function(){
$('#inner').animate({ top: '100%' }, 'easein' );
}
);
Here it is in action.

aziz punjani
- 25,586
- 9
- 47
- 56