Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 深夜福利一区,欧美一区二区三区在线,国产精品成人观看视频国产

          整合營(yíng)銷(xiāo)服務(wù)商

          電腦端+手機(jī)端+微信端=數(shù)據(jù)同步管理

          免費(fèi)咨詢熱線:

          話說(shuō)前端(1)-前端a標(biāo)簽的使用

          擊藍(lán)字 關(guān)注我們


          分享興趣,傳播快樂(lè),增長(zhǎng)見(jiàn)聞,留下美好!親愛(ài)的您,這里是Learning yard新學(xué)苑。今天小編為大家?guī)?lái)《a標(biāo)簽的使用方法》。

          Share interest, spread happiness, increase knowledge, and leave behind beauty! Dear you, this is Learning yard New Academy. Today, Xiaobian brings you "How to Use A Label".

          前端網(wǎng)頁(yè)的打開(kāi)方式:

          一般用標(biāo)簽a來(lái)引用例如<a href=”#”></a>填寫(xiě)#的地方就是你需要跳轉(zhuǎn)的網(wǎng)站例如:

          How to open the front page:

          Generally, web pages are quoted by the label A, for example < a href = "#" > </a > The place where # is filled in is the website you need to jump to, for example:


          標(biāo)簽中間寫(xiě)字,就可以得到以下效果:

          里頭的字默認(rèn)就是藍(lán)色,有下劃線。當(dāng)然字體也可以調(diào)整可以通過(guò)css里的text-decoration:none,來(lái)取消下劃線,通過(guò)color來(lái)調(diào)整字體顏色。代碼效果如下

          The words in it are blue by default and underlined. Of course, the font can also be adjusted. You can cancel the underline by text-decoration: none in css, and adjust the font color by color. The code effect is as follows


          咱們?cè)倩氐骄W(wǎng)站最重要的一點(diǎn)就是打開(kāi)方式,用target來(lái)引用,樣式為<a href=”#” target=””></a>,其中有blank,在新的一個(gè)頁(yè)面打開(kāi),self,在本頁(yè)面打開(kāi)(默認(rèn)為)parent(在a里面打開(kāi),以后知識(shí)齊全再講)以及top 和framename最常用的就是前兩個(gè)。

          Let's go back to the website's most important point, which is how to open it. Use target to quote it, and the style is < a href = "#" target = "> </a >, among which blank, open on a new page, self, open on this page (default is) parent (open in A, we'll talk about it later), top and framename, and the most commonly used ones are the first two.

          總結(jié)如下:

          Summarize as follows:

          今天的分享就到這里了。如果您對(duì)今天的文章有什么獨(dú)特的想法,歡迎評(píng)論留言,讓我們相約明天,祝您今天過(guò)得開(kāi)心快樂(lè)!

          That's it for today's sharing. If you have any unique ideas for today's article, please leave a comment, let us meet tomorrow, I wish you a happy day!

          LearningYard學(xué)苑

          分享興趣,傳播快樂(lè),增長(zhǎng)見(jiàn)聞,留下美好!少年易老學(xué)難成,一寸光陰不可輕

          本文由learningyard新學(xué)苑原創(chuàng),如有侵權(quán),請(qǐng)聯(lián)系刪除。

          翻譯來(lái)源:谷歌翻譯

          排版:李仕陽(yáng)

          文本:李仕陽(yáng)

          審核:閆慶紅

          HTML 中,通過(guò) JavaScript 來(lái)獲取當(dāng)前元素的高度通常使用以下屬性:

          var element = document.getElementById("yourElementId"); // 獲取元素var height = element.offsetHeight; // 獲取元素高度(包括padding、border,但不包括margin)

          如果你想獲取元素的 CSS 定義的高度(不包括 padding 和 border),可以使用 style.height,但這只能獲取到直接寫(xiě)在元素行內(nèi)樣式中的高度,而不是計(jì)算后的實(shí)際高度或 CSS 樣式表中定義的高度:

          var heightInStyle = element.style.height; // 只獲取行內(nèi)樣式設(shè)置的高度

          在 React 中獲取當(dāng)前元素的高度方式與 JavaScript 相似,但是你需要確保在 DOM 更新后獲取元素高度??梢允褂?ref 來(lái)訪問(wèn)實(shí)際 DOM 節(jié)點(diǎn)并獲取其高度:

          import React, { useRef, useEffect } from 'react';function YourComponent() {  const elementRef = useRef(null);  useEffect(() => {    if (elementRef.current) {      // 在這里,elementRef.current.clientHeight 獲取元素的內(nèi)容區(qū)域高度(不包括padding和border)      // elementRef.current.offsetHeight 獲取元素的實(shí)際渲染高度(包括padding和border,但不包括margin)      console.log('Element height:', elementRef.current.offsetHeight);
              }
            }, []); // 確保此useEffect只在組件掛載后執(zhí)行一次  return (    <div ref={elementRef}>
                {/* 你的組件內(nèi)容 */}    </div>
            );
          }export default YourComponent;

          在上述代碼中,useRef 創(chuàng)建了一個(gè)可變的引用對(duì)象,它可以用來(lái)保存任何可變值,包括 DOM 節(jié)點(diǎn)。然后通過(guò)將這個(gè) ref 對(duì)象賦給元素的 ref 屬性,React 會(huì)將對(duì)應(yīng)的 DOM 節(jié)點(diǎn)保存到這個(gè) ref 對(duì)象的 .current 屬性上,這樣我們就可以在回調(diào)函數(shù)或者其他適當(dāng)?shù)牡胤皆L問(wèn)到該 DOM 節(jié)點(diǎn),并獲取其高度了。

          如果要在圖片加載完成后獲取包含圖片的元素高度,可以監(jiān)聽(tīng)圖片的 load 事件。在 React 中,你可以在組件內(nèi)創(chuàng)建一個(gè)圖片引用,并在 useEffect 中監(jiān)聽(tīng)圖片加載完成:

          import React, { useRef, useEffect } from 'react';function YourComponent() {  const elementRef = useRef(null);  const imgRef = useRef(null);  useEffect(() => {    const handleImageLoad = () => {      if (elementRef.current) {        console.log('Element height after image load:', elementRef.current.offsetHeight);
                }
              };    // 如果img已經(jīng)存在于DOM中,則立即觸發(fā)handleImageLoad    // 否則,在img加載完成后觸發(fā)handleImageLoad    if (imgRef.current && imgRef.current.complete) {      handleImageLoad();
              } else {
                imgRef.current.onload = handleImageLoad;
              }    // 可以選擇在組件卸載時(shí)清除事件監(jiān)聽(tīng),避免內(nèi)存泄漏    return () => {
                imgRef.current.onload = null;
              };
            }, []); // 確保此useEffect只在組件掛載后執(zhí)行一次  return (    <div ref={elementRef}>      <img src="your-image-source.jpg" ref={imgRef} alt="Your Image" />
                {/* 其他內(nèi)容 */}    </div>
            );
          }export default YourComponent;

          這樣,當(dāng)圖片加載完成后,就會(huì)觸發(fā) handleImageLoad 函數(shù),從而獲取到包含圖片的元素的實(shí)際高度。

          如果圖片是服務(wù)端渲染的,并且你無(wú)法直接在 img 標(biāo)簽上添加 ref,你可以考慮監(jiān)聽(tīng)整個(gè)組件的 onLoad 事件來(lái)判斷圖片是否加載完成。由于 React 在瀏覽器中重新渲染時(shí)會(huì)保留 DOM 節(jié)點(diǎn)(除非有更改),所以可以通過(guò)檢查元素的 offsetHeight 是否有變化來(lái)判斷圖片是否加載完畢。

          用射線拾取Raycaster、OutlinePass選中的物體進(jìn)行高亮顯示,并用CSS2DObject、CSS2DRenderer把dom元素插入到場(chǎng)景中顯示

          一、預(yù)覽

          <script src="https://lf6-cdn-tos.bytescm.com/obj/cdn-static-resource/tt_player/tt.player.js?v=20160723"></script>

          二、安裝

          npm install three

          三、代碼


          主站蜘蛛池模板: 亚洲国产欧美一区二区三区 | 久久国产精品视频一区| 国产福利电影一区二区三区,免费久久久久久久精 | 99久久精品国产免看国产一区| 亚洲AV噜噜一区二区三区| 日韩一区二区超清视频| 岛国精品一区免费视频在线观看| 欧洲亚洲综合一区二区三区| 精品人妻一区二区三区浪潮在线| 国产成人无码AV一区二区在线观看 | 国产一区二区精品久久岳| 国产精品成人99一区无码| 国产精品成人免费一区二区| 精品无码一区二区三区电影| 99精品一区二区三区| 少妇激情av一区二区| 91精品福利一区二区三区野战| 国产成人一区二区三区在线观看| 中文字幕一区日韩在线视频| 精品国产一区二区三区AV性色| 无码人妻一区二区三区在线水卜樱| 国内精品视频一区二区八戒| 国产精品盗摄一区二区在线| 无码一区二区三区亚洲人妻 | www一区二区www免费| 国产精品无码不卡一区二区三区| 色综合一区二区三区| 亚洲国产激情一区二区三区| 中文字幕不卡一区| 国产免费一区二区视频| 无码少妇一区二区性色AV| 熟妇人妻AV无码一区二区三区| 久久伊人精品一区二区三区 | 污污内射在线观看一区二区少妇| 一夲道无码人妻精品一区二区 | 国产aⅴ精品一区二区三区久久| 国产成人精品亚洲一区| 本免费AV无码专区一区| 亚洲综合一区二区国产精品| 亚洲性无码一区二区三区| 国产精品熟女视频一区二区|