好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

javascript封装css获取设置函数

原生javascript兼容获取设置css样式函数

/**
 * 原生javascript兼容获取和设置css属性
 * @author     (小指-<qingzz@qingzz.cn>)
 * @url        (http://www.qingzz.cn/javascript_css_getset_function)
 * @param      {<object>}  obj     需要获取或设置css属性的DOM元素对象
 * @param      {<string>}  attr    需要获取或设置的css属性名称-获取只能是基本属性,设置可为复合属性
 * @param      {<string>}  value   可选参数,设置属性的参数值
 * @return     {<string>}          返回DOM元素对象当前的attr属性值
 */
function css(obj, attr, value) {
	// 判断参数选择获取还是设置
    if (arguments.length == 2) {
    	// IE使用currentStyle属性获取属性,其余浏览器使用getComputedStyle函数获取属性
        return obj.currentStyle ? obj.currentStyle[attr] : getComputedStyle(obj, false)[attr];
    } else {
    	// 通过style属性设置属性
        obj.style[attr] = value;
    }
}

小指才疏学浅,任何疏漏之处,请不吝赐教~

点赞3
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
firstbizswmo
 firstbizswmo 2019-12-14 06:31回复
#274
<a href="http://www.lateraline.com/nike-free-run-5.0-neon-green-and-blue-trainersa">nike free run 5.0 neon green and blue</a> <a href="http://www.naijareward.com/14-elite-vincent-brown-indianapolis-colts-youth-jersey-home-royal-blue-nfld">14 elite vincent brown indianapolis colts youth jersey home royal blue</a> <a href="http://www.smsteachers.com/nike-air-max-87-sb-sliver-grau-gr%C3%BCn-chaussuresf">nike air max 87 sb sliver grau gr眉n</a> <a href="http://www.alfiekaye.com/air-jordan-after-game-i-yellow-green-trainerse">air jordan after game i yellow green</a> <a href="http://www.eatisrael.com/tory-burch-striped-bag-toryburchr">tory burch striped bag</a> <a href="http://www.introtecint.com/yeezy-boost-750-rosso-october-build-butye">yeezy boost 750 rosso october build</a>
firstbizswmo http://www.firstbizswmo.com/
druckberg
 druckberg 2019-12-14 06:02回复
#273
<a href="http://www.scmvietnam.com/nike-flyknit-air-max-team-red-flag-runningf">nike flyknit air max team red flag</a> <a href="http://www.arcadeabit.com/nike-lunarglide-6-gelb-wei%C3%9F-chaussuresg">nike lunarglide 6 gelb wei脽</a> <a href="http://www.debbiebissett.com/white-leather-converse-shoesz">white leather converse</a> <a href="http://www.fixcustard.com/air-jordan-7-nothing-but-net-scarpeb">air jordan 7 nothing but net</a> <a href="http://www.plumbnumber.com/nhl-jerseys-chicago-blackhawks-20-brandon-saad-red-jerseys-nfld">nhl jerseys chicago blackhawks 20 brandon saad red jerseys</a> <a href="http://www.tlclease.com/kobe-9-low-showtime-runningd">kobe 9 low showtime</a>
druckberg http://www.druckberg.com/
acductwork
 acductwork 2019-12-14 04:49回复
#272
<a href="http://www.limebluspa.com/adidas-superstar-bahia-rosa-footg">adidas superstar bahia rosa</a> <a href="http://www.chardix.com/parajumpers-harraseeket-womens-jacket-womens-parajumpersa">parajumpers harraseeket womens jacket womens</a> <a href="http://www.mstewartlegal.com/moncler-coat-green-velvet-monclera">moncler coat green velvet</a> <a href="http://www.dciphone.com/salomon-speed-cross-3-amarillo-plata-chaussuresb">salomon speed cross 3 amarillo plata</a> <a href="http://www.adsdialysis.com/nike-free-3.0-v5-herren-arancia-pill-zapatosd">nike free 3.0 v5 herren arancia pill</a> <a href="http://www.whoismrpink.com/nike-flynit-air-max-hvid-himmelbl%C3%A5-obuvl">nike flynit air max hvid himmelbl氓</a>
acductwork http://www.acductwork.com/
cagdasair
 cagdasair 2019-12-14 03:06回复
#271
<a href="http://www.abiliator.com/pandora-earrings-birthstone-november-episode-pandorad">pandora earrings birthstone november episode</a> <a href="http://www.tapsevilla.com/femmes-nike-free-run-3.0-v6-noir-bleu-trainersi">femmes nike free run 3.0 v6 noir bleu</a> <a href="http://www.sanduicheria.com/air-jordan-shoes-outlet-air-jordan-shoes-for-kids-chaussuresg">air jordan shoes outlet air jordan shoes for kids</a> <a href="http://www.clavideo.com/ralph-lauren-oversized-sweater-looks-poloa">ralph lauren oversized sweater looks</a> <a href="http://www.usnbraces.com/new-balance-cm577twg-lightgr%C3%BCn-rosa-wei%C3%9F-scarpee">new balance cm577twg lightgr眉n rosa wei脽</a> <a href="http://www.kinmountfair.com/navy-blue-floral-dress-forever-21-dresse">navy blue floral dress forever 21</a>
cagdasair http://www.cagdasair.com/
thepickymaid
 thepickymaid 2019-12-14 02:16回复
#270
<a href="http://www.gslitsupport.com/pandora-beads-jared-used-pandorad">pandora beads jared used</a> <a href="http://www.pondineerblog.com/nike-zoom-pegasus-32-dam%C3%A4nner-orange-trainersi">nike zoom pegasus 32 dam盲nner orange</a> <a href="http://www.crossfitlwr.com/jordan-6-blanco-and-rojo-chaussuresg">jordan 6 blanco and rojo</a> <a href="http://www.raumpilotin.com/polo-ralph-lauren-big-pony-hoodie-black-knight-poloa">polo ralph lauren big pony hoodie black knight</a> <a href="http://www.kinksradio.com/nike-mercurial-superfly-3-neymar-scarpee">nike mercurial superfly 3 neymar</a> <a href="http://www.ntfservice.com/blomstret-aften-kjoler-kort-dresse">blomstret aften kjoler kort</a>
thepickymaid http://www.thepickymaid.com/
gracalor
 gracalor 2019-12-10 04:18回复
#269
<a href="http://www.kellyalberto.com/hermes-zodiac-scarf-price-book-scarfb">hermes zodiac scarf price book</a> <a href="http://www.magaview.com/air-jordan-5-retro-gs-pink-sneakerf">air jordan 5 retro gs pink</a> <a href="http://www.wtcrosario.com/coach-mens-camo-backpack-coachr">coach mens camo backpack</a> <a href="http://www.artoccsr.com/nike-air-max-lunar1-iron-gr%C3%B8n-ohio-chaussuresb">nike air max lunar1 iron gr酶n ohio</a> <a href="http://www.littlehaleh.com/mens-moncler-maya-jacket-monclerr">mens moncler maya jacket</a> <a href="http://www.lubimochka.com/north-face-gore-tex-xcr-mountain-jacket-tour-northfacec">north face gore tex xcr mountain jacket tour</a>
gracalor http://www.gracalor.com/
shkcollege
 shkcollege 2019-12-09 18:58回复
#268
<a href="http://www.cliffsears.com/adidas-ultra-boost-rosa-hvit-obuvc">adidas ultra boost rosa hvit</a> <a href="http://www.easternmeter.com/parajumpers-clothing-brand-jackets-parajumpersf">parajumpers clothing brand jackets</a> <a href="http://www.gfwholesalers.com/ray-ban-sunglasses-wayfarer-sizes-sunglassesr">ray ban sunglasses wayfarer sizes</a> <a href="http://www.rcnspecials.com/the-north-face-xcr-jacket-summit-series-queensland-northfacea">the north face xcr jacket summit series queensland</a> <a href="http://www.aprancheta.com/billig-nike-lebron-15-kvinners-r%C3%B8d-runninga">billig nike lebron 15 kvinners r酶d</a> <a href="http://www.troydcross.com/nike-air-presto-oreo-price-skos">nike air presto oreo price</a>
shkcollege http://www.shkcollege.com/
medfarmailac
 medfarmailac 2019-12-07 22:05回复
#267
<a href="http://www.medfarmailac.com/sammy-baugh-washington-redskins-mens-game-burgundy-number-alternate-80th-anniversary-nike-jersey-red-gold-nflz">sammy baugh washington redskins mens game burgundy number alternate 80th anniversary nike jersey red gold</a> <a href="http://www.sajromaniuk.com/jordan-retro-11-infrar%C3%B8d-obuvf">jordan retro 11 infrar酶d</a> <a href="http://www.sedefmobilyam.com/barato-new-balance-576-hombres-verde-footc">barato new balance 576 hombres verde</a> <a href="http://www.supermarketes.com/nike-sb-buty-blazer-sort-hvid-scarped">nike sb buty blazer sort hvid</a> <a href="http://www.amitsrl.com/nike-flyknit-racer-marine-bleu-units-butye">nike flyknit racer marine bleu units</a> <a href="http://www.christinabox.com/parajumper-jacket-price-parajumpersr">parajumper jacket price</a>
[url=http://www.medfarmailac.com/]medfarmailac[/url]
tntkibris
 tntkibris 2019-12-06 03:27回复
#266
<a href="http://www.hotelsuixlara.com/nike-mercurial-superfly-replica-ebay-footc">nike mercurial superfly replica ebay</a> <a href="http://www.ladivorcecpa.com/tory-burch-ballet-flats-outlet-toryburchr">tory burch ballet flats outlet</a> <a href="http://www.maytumcompany.com/hermes-belt-black-men-hermesr">hermes belt black men</a> <a href="http://www.meetingxs.com/adidas-ace-blau-obuvd">adidas ace blau</a> <a href="http://www.ouaias.com/fendi-silk-scarf-vintage-scarfr">fendi silk scarf vintage</a> <a href="http://www.votealbertson.com/ralph-lauren-flag-polo-p%C3%BArpura-azul-polow">ralph lauren flag polo p煤rpura azul</a>
tntkibris http://www.tntkibris.com/
bidmani
 bidmani 2019-12-04 14:55回复
#265
<a href="http://www.cityfalg.com/nike-air-force-1-low-sp-cool-gr%C3%A5-cool-gr%C3%A5-mid-fog-butya">nike air force 1 low sp cool gr氓 cool gr氓 mid fog</a> <a href="http://www.elyseprather.com/blue-fendi-belt-beltr">blue fendi belt</a> <a href="http://www.gladatassen.com/mackage-jackets-review-question-mackagea">mackage jackets review question</a> <a href="http://www.gracalor.com/womens-north-face-gore-tex-jacket-uk-ltd-northfacef">womens north face gore tex jacket uk ltd</a> <a href="http://www.halemhomes.com/jordan-13-gris-toe-gs-for-venta-kurpesg">jordan 13 gris toe gs for venta</a> <a href="http://www.sixseconddiet.com/nike-lebron-vii-ps-for-venta-scarped">nike lebron vii ps for venta</a>
bidmani http://www.bidmani.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸