国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > JavaScript > 正文

基于jQuery實(shí)現(xiàn)收縮展開(kāi)功能

2019-11-20 10:22:21
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

本文實(shí)例向大家分享了一款基于jQuery實(shí)現(xiàn)收起展開(kāi)功能特效,供大家參考,具體內(nèi)容如下

效果圖:

點(diǎn)擊倒三角可以進(jìn)行展開(kāi)操作

具體代碼:

<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>jQuery實(shí)現(xiàn)收起展開(kāi)功能 - 何問(wèn)起</title><base target="_blank" /><meta charset="utf-8" /><style>a{color:darkgreen}.hovertreeContent{width:300px;text-indent:2em;margin:5px auto;height:60px;overflow:hidden;position:relative;border:1px solid silver;}.hewenqiToggle{height:20px;background-color:#f0f0f0;border-top:1px solid silver;position:absolute;bottom:0px;width:100%;}.triangle-down-hovertree { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 16px solid #999;position:absolute;right:0px;left:0px;margin:0px auto; top:2px;cursor:pointer;}.triangle-up-hovertree { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 16px solid #999; position:absolute;right:0px;left:0px;margin:0px auto;top:2px; }</style><script src="http://hovertree.com/ziyuan/jquery/jquery-1.12.1.min.js"></script> </head><body><div style="width:730px;margin:0px auto;text-align:center;"><h2>jQuery實(shí)現(xiàn)收起展開(kāi)功能</h2><a href="#">原文</a> <a href="#">首頁(yè)</a> <a href="#">特效</a></div><div class="hovertreeContent">受到網(wǎng)店的影響,服裝店的生意逐漸有所下降,老板找何問(wèn)起去談,大概是準(zhǔn)備跟上網(wǎng)購(gòu)潮流,讓何問(wèn)起準(zhǔn)備一下,要在網(wǎng)上開(kāi)網(wǎng)店,要為服裝店建立網(wǎng)站。何問(wèn)起也沒(méi)說(shuō)自己經(jīng)驗(yàn)不足,只說(shuō)會(huì)積極準(zhǔn)備。于是抓緊時(shí)間查找資料,學(xué)習(xí)練習(xí)。<div class="hewenqiToggle"><span class="triangle-down-hovertree"></span></div></div><script>$(".hewenqiToggle").on("click", function () {if ($(".hewenqiToggle").css('position') == "absolute") {$(".hovertreeContent").height("auto");$(".hewenqiToggle").css({ "position": "relative" });$(".hewenqiToggle").find("span").removeClass('triangle-down-hovertree').addClass('triangle-up-hovertree');}else{$(".hovertreeContent").height("60");$(".hewenqiToggle").css({ "position": "absolute" });$(".hewenqiToggle").find("span").removeClass('triangle-up-hovertree').addClass('triangle-down-hovertree');}})</script></body></html>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家學(xué)習(xí)jquery程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 扎兰屯市| 永登县| 茶陵县| 宝丰县| 东源县| 铅山县| 望奎县| 壤塘县| 张家口市| 苍梧县| 土默特右旗| 永丰县| 和静县| 临夏市| 泽州县| 丰镇市| 西盟| 松江区| 富民县| 黄陵县| 旬邑县| 富宁县| 太湖县| 昌宁县| 东乡族自治县| 华亭县| 尼勒克县| 琼结县| 临泽县| 岳阳县| 彝良县| 荥阳市| 永城市| 惠安县| 包头市| 舞阳县| 南部县| 图木舒克市| 那坡县| 新泰市| 宜丰县|