jquery Implementation div display hide and change div text description

Source: Internet
Author: User

Figure 1 hiding

Figure 2 shows

JS Code

The code is as follows Copy Code

<script>
$ (function () {
$ ("#more_1"). Click (function () {

if ($ (". Qy_more"). Hasclass ("More_1"))
{
$ (". Qy_more"). Removeclass ("More_1");
$ (this). html ("hidden");
}

else{
$ (". Qy_more"). attr ("Class", "More_1 Qy_more");
$ (this). HTML ("more >>");
}
})

})
</script>

HTML code

The code is as follows Copy Code


<a id= "More_1" > More >></a>

<div class= "More_1 qy_more" >
       <span class= "Cityjia" ><a href= "cityid=2704&h=1" > Jiamusi </a ><span class= "CityLine" >|</span></span><span class= "Cityjia" >www.111cn.net<a "href=" ? cityid=2715&h=1 "> Mudanjiang </a><span class=" CityLine ">|</span></span><span class=" Cityjia "><a href=" "Cityid=2727&h=1" > Ganzhou </a><span class= "CityLine" >|</span></ Span><span class= "Cityjia" ><a href= "cityid=2751&h=1" > Jiujiang </a><span class= "CityLine" >|</span></span><span class= "Cityjia" ><a href= "cityid=2767&h=1" > Ji ' an </a>< Span class= "CityLine" >|</span></span><span class= "Cityjia" ><a href= "? cityid=2768&h=1" > Shangrao </a><span class= "CityLine" >|</span></span><span class= "Cityjia ><a"? Cityid=2781&h=1 "> Yichun </a><span class=" CityLine ">|</span></span>
<div class= "Clear" ></div>
</div>

CSS Code

The code is as follows Copy Code

. more_1{ Display:none;}
. qy_more{width:1050px;z-index:22;margin-left:75px;}
#more_1 {color: #5FA4C6; background:none; top:20px; left:1130px; padding:0px; margin-top:4px; position:absolute;}
. Qy_more a {float:left;padding:3px 5px;}
. qy_more a:hover {float:left; Background-color: #fce8d6; color: #666;p adding:3px 5px;}
. posi_xs {position:relative; z-index:22;}
#more_1 {cursor:pointer;}
. shadow{margin:0 auto;background: #fff;
Filter:progid:DXImageTransform.Microsoft.Shadow (color= #e6e6e6, direction=120,strength=4);/* Compatible
ie*/
- moz-box-shadow:2px 2px 10px #e6e6e6/* www.111cn.net compatible firefox*/
-webkit-box-shadow:2px 2px 10px #e6e6e6;/* Compatible with Safari or chrome*/
box-shadow:2px 2px 10px #e6e6e6;/* compatible with opera or ie9*/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.