




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、項(xiàng)目1類的應(yīng)用divwidth:60px;height:60px;background-color: #7FFF00;border-radius: 50%; float:left; margin-left: 10px;/div顯示出來前面的不能加./類定義前面加.boxwidth:372px; height:494px ;overflow: hidden;position: relative;top: 60px;left:50%/box是盒子只能放一張圖片 overflow 多余超出隱藏 position 相對父級移動的位置 圖片的位置居中.click span float:left;marg
2、in-left: 10px;margin-right: 10px; width:10px;height: 10px;background-color: red;border-radius: 50%;overflow: hidden;position: relative;top: 60px;left:50%;/span是點(diǎn).click span定義了一個類 也是一個框架框起來作用 margin-left right 是相對于頁面的上下左右的變化彼此之間的距離/div 和span 加上浮動都是一樣的標(biāo)簽 /一個父級框起來可以一起定義效果$(img).hide()/一開始沒有圖像$(span:eq(
3、0).click(function()$(img:eq(0).show()$(img:eq(0).siblings().hide()$(this).css(backgroundColor:yellow)$(this).siblings().css(backgroundColor:red)/this相對應(yīng)的是最外面()里的span)$(span:eq(1).click(function()$(img:eq(1).show()$(img:eq(1).siblings().hide()$(this).css(backgroundColor:yellow)$(this).siblings().css(
4、backgroundColor:red)$(span:eq(2).click(function()$(img:eq(2).show()$(img:eq(2).siblings().hide()$(this).css(backgroundColor:yellow)$(this).siblings().css(backgroundColor:red)$(span:eq(3).click(function()$(img:eq(3).show()$(img:eq(3).siblings().hide()$(this).css(backgroundColor:yellow)$(this).sibling
5、s().css(backgroundColor:red)$(span:eq(4).click(function()$(img:eq(4).show()$(img:eq(4).siblings().hide()$(this).css(backgroundColor:yellow)$(this).siblings().css(backgroundColor:red)項(xiàng)目2 Css的應(yīng)用.text1 background-color:white;.text1 figcaption padding:20px;.text1 figcaption pbackground-color:#FFF;margin
6、 3px;text-align: center; padding:0 10px; transform: translate(-120px,0px);.text1 p:nth-of-type(1)transition-delay:0.3s;.text1 p:nth-of-type(2)transition-delay:0.8s;.text1 p:nth-of-type(3)transition-delay:1.3s;.text1:hover ptransform: translate(0,0);.text1:hoverimgopacity:0.5;transform:translate(-50p
7、x,0);/css層疊樣式 引用一個text類定義就包括了所有的動效/text1 是聲明 這些是寫在body里面的第一標(biāo)題 圖片注解 圖片注解 圖片注解/figure是父級包括了figcaption.box5background-color:blanchedalmond ;.boxheight: 100px;.box2background-color:blanchedalmond ;.box3 font-size:50px;.box5background-color:blanchedalmond ;文字$(.box5).css(color:red,fontSize: 34)/新定義css樣式項(xiàng)
8、目3$(div).width();/width寬度()沒寫是捕獲 寫了是設(shè)置document.title=$(div).width()/document 頭部內(nèi)容是用來檢測變化的$(div).height();/height 高度document.title=$(div).height() helloworld/padding 內(nèi)邊距 padding-top 從上往下 hin 細(xì)線 medium 中粗線 thick 粗線 邊框類型 none 無邊框 dotted 點(diǎn)組成 dashed 由短線 solid 實(shí)線 double 雙線 groove 3d溝槽 顏色$(div).outerHeight
9、();/包含填充padding 和邊框document.title=$(div).outerHeight()heoworld/margin 外邊距 margin “20px 40px” top bottom20px right left 40px 20 40 60 80 top right bottom left$(div).outerHeight(true);/true 填充 邊框 邊界都包含document.title=$(div).outerHeight(true) helloworld$(div).innerHeight(true);/innerHeight 帶padding值的高度d
10、ocument.title=$(div).innerHeight(true)項(xiàng)目4/JS 聲明類型 不需要調(diào)用庫 直接輸出就可以 用于if語句 輪播 函數(shù)類型 var i=1/ VAR 和變量之間要有空格 var 變量名=數(shù)值i=i+1document.title=ialert(hello)/彈窗var a=confirm(are your sure?)/布爾 TRUE falsedocument.title=a;var b=prompt(please input your name, 0);/可輸入文本 字符用引號包含document.title=your name are+b;/運(yùn)行從上往
11、下 變量運(yùn)算 + - * / 比較運(yùn)算 = != =項(xiàng)目5alert(hello)var a=confirm(are your sure?)var b=prompt(please input your chronically age)if(b=18)/if (布爾值 true會顯示 false 不會顯示)document.title=you are + b+ years old/空格在引號中elsedocument.title=you are too young /語句后不能加分號 分號在外可以加項(xiàng)目6document.getElementById(box).style.height=100p
12、xdocument.getElementById(box).style.width=100pxdocument.getElementById(box).style.backgroundColor=blanchedalmond#boxwidth: 372px;height: 494px;/必須定義style盒子圖片 捕獲樣式/類調(diào)用var i=prompt(請輸入你的對象,0)if(i=1)document.getElementById(box).style.backgroundImage=url(img/p_1.png)/if()兩個= style 相當(dāng)于調(diào)用css js圖片必須有url 顯示
13、在彈出的窗口 捕獲屬性樣式else if(i=2)document.getElementById(box).style.backgroundImage=url(img/p_2.png)/圖片的順序必須一致else if(i=3)document.getElementById(box).style.backgroundImage=url(img/p_3.png)/if 語句結(jié)尾不能有冒號else if(i=4)document.getElementById(box).style.backgroundImage=url(img/p_4.png)else if(i=5)document.getEle
14、mentById(box).style.backgroundImage=url(img/p_5.png)elsealert(輸入錯誤定義)/最后的else 沒有()小括弧imgdisplay: none;/背景有大小才顯示var a=prompt(input you favorite number,0)document.getElementsByTagName(img).item(a-1).style.display=block/駝峰寫法 a-1表示第一個 捕獲標(biāo)簽 每個都要加.var a=prompt(input you favorite number,0)/prompt 中的a變量就是鍵盤
15、輸入的文本if(a=5)document.getElementsByTagName(img).item(a-1).style.display=blockelsealert(worry number)項(xiàng)目7var use=new Array();/定義一個數(shù)組盒子use0=土豆use1=胡蘿卜use2=西紅柿use3=白菜use4=芹菜var who=Math.floor(Math.random()*5);/Math.floor 只取整數(shù)Math.random取隨機(jī)數(shù)0-1之間 5是范圍document.title=今天吃 + usewho/數(shù)組盒子包著變量項(xiàng)目8imgdisplay: none
16、;/用js要事先聲明function appear(a) function直接跟括號 沒有符號document.getElementsByTagName(img).item(a-1).style.display=block/ var a=prompt(input you favorite number,0) 原來的函數(shù)名 appear 是類型 函數(shù)的事件 js比JQfunction()中多了函數(shù)名appear(3)/只用于檢測 相當(dāng)于 a=3 省略了/JS的定義onclick 單擊 onblur 失去焦點(diǎn) onmousemove鼠標(biāo)移入 onkeyup 按鍵彈起function dianji()/可以多次回調(diào)alert(這個類型不能用)/事件dianji()/不能是click 和庫重復(fù)項(xiàng)目9imgdisplay: none;function tanchu(
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025外匯質(zhì)押人民幣貸款合同范本
- 民間資金借款抵押合同
- 藥材種植協(xié)議書范本
- 2025商業(yè)混凝土銷售合同范本
- 婚后貸款協(xié)議書范本
- 藏獒轉(zhuǎn)賣協(xié)議書模板
- 2025年03月河北邯鄲武安市事業(yè)單位春季博碩人才引進(jìn)55名筆試歷年典型考題(歷年真題考點(diǎn))解題思路附帶答案詳解
- 2025年03月新疆阿勒泰地區(qū)吉木乃縣紅十字會招募紅十字志愿者筆試歷年典型考題(歷年真題考點(diǎn))解題思路附帶答案詳解
- Unit 9 From Here to There 第三課時Developing the Topic(含答案)仁愛版2024七下英語日清限時練
- 武漢鐵路職業(yè)技術(shù)學(xué)院《智能機(jī)器人》2023-2024學(xué)年第二學(xué)期期末試卷
- 2024年廣東省萬閱大灣區(qū)百校聯(lián)盟中考一模數(shù)學(xué)試題
- 《短視頻拍攝與制作》課件-3短視頻中期拍攝
- 數(shù)字貿(mào)易學(xué) 課件 馬述忠 第13-22章 數(shù)字貿(mào)易綜合服務(wù)概述- 數(shù)字貿(mào)易規(guī)則構(gòu)建與WTO新一輪電子商務(wù)談判
- 2024年電路保護(hù)元器件行業(yè)營銷策略方案
- 污泥技術(shù)污泥運(yùn)輸方案
- 年產(chǎn)3.5萬噸丙烯腈合成工段工藝設(shè)計課程設(shè)計
- 【方案】分布式光伏項(xiàng)目勘察及建設(shè)方案
- 半導(dǎo)體行業(yè)對國家國防戰(zhàn)略的支撐與應(yīng)用
- 智能點(diǎn)滴自動監(jiān)控方法設(shè)計
- 辦學(xué)許可證續(xù)期申請書
- Cpk及Ppk計算電子表格模板
評論
0/150
提交評論