For the first time on my own complete package of small effects, a little excitement, and you share, I hope to be the same as I in the exploration of the children's shoes a little Help
js section:
Copy Code code as follows:
var show_obj = function (obj,at,ob) {
$ (obj). bind (' click ', Function () {
var showtxt = $ (this). Children (at);
//alert ($ (at). HTML ());
//alert (sobj);
//alert ();
//alert ($ (this). Parent (). Children (P). HTML ());
if (showtxt.html () = = ' + ') {
showtxt.html ('-')
}else{
showtxt.html (' + ')
}
$ (this). Parent (). Children (OB). Slidetoggle (300);
})
}
HTML Reference:
Copy Code code as follows:
$ (function () {
show_obj ('. Slide_show ', '. Slide_show a ', '. P-silde ');
})
HTML code:
<ul>
<li>
<div class= "Clearfix slide_show" ><span style= "Float:left" > I have a list </span><a style= "float: Right ">+</a></div>
<p class= "P-silde" style= "Display:none" >
<a href= "#" > List 1</a>
<a href= "#" > List 2</a>
<a href= "#" > List 3</a>
</p>
</li>
<li>
<div class= "Clearfix slide_show" ><span style= "Float:left" > I have a list </span><a style= "float: Right ">+</a></div>
<p class= "P-silde" style= "Display:none" >
<a href= "#" > List 1</a>
<a href= "#" > List 2</a>
<a href= "#" > List 3</a>
</p>
</li>
<li>
<div class= "Clearfix slide_show" ><span> I don't have a list </span></div>
</li>
</ul>
PS: Remember to refer to the framework of jquery, compatible IE6 above, Firefox, Google, IE6 no test you can test yourself