ホームページ ウェブフロントエンド jsチュートリアル jsタイマーの使い方(例で解説)_javascriptスキル

jsタイマーの使い方(例で解説)_javascriptスキル

May 16, 2016 pm 05:05 PM
js タイマー

JavaScript には、タイマー専用の関数が 2 つあります。つまり、

1. カウントダウンタイマー: timename=setTimeout("function();",laytime);
2. ループタイマー: timename=setInterval("function();",laytime);

最初のパラメータ「function()」は、タイマーがトリガーされたときに実行されるアクションです。1 つの関数または複数の関数を「;」で区切ることができます。たとえば、2 つの警告ウィンドウをポップアップ表示したい場合は、「function();」を
「alert('最初の警告ウィンドウ!');alert('2 番目の警告ウィンドウ!');」に置き換えることができます。 2 番目のパラメータ「laytime」はミリ秒単位の間隔時間です。つまり、「5000」と入力すると 5 秒を意味します。
カウントダウン タイマーは指定された時間に達した後にイベントをトリガーしますが、ループ タイマーは間隔が来ると繰り返しイベントをトリガーします。これら 2 つの違いは、前者は 1 回だけ動作するのに対し、後者は継続的に動作することです。
たとえば、ページを開いた後、数秒ごとに別のページに自動的にジャンプしたい場合は、カウントダウン タイマー "setTimeout("function();",laytime)" を使用する必要があります。一度に 1 単語ずつ表示されるように文を設定する場合、
ではループ タイマー "setInterval("function();",laytime)" を使用する必要があります。

フォームのフォーカスを取得するには、document.activeElement.id が使用されます。 if を使用して、document.activeElement.id とフォームの ID が同じかどうかを判断します。
例: if ("mid" == document.activeElement.id) {alert();}、「mid」はフォームに対応する ID です。

タイマー:
は、特定の時間後に実行されるプログラムを指定するために使用されます。

JSでの実行タイミング、setTimeoutとsetIntervalの違い、キャンセル方法

setTimeout(Expression,DelayTime)、DelayTime の後に、setTimeout を使用して、操作を実行する前に一定期間遅延させます。
setTimeout("function",time) はタイムアウト オブジェクトを設定します

setInterval(expression, lateTime)、Expression は DelayTime ごとに実行されます。
setInterval("function", time) はタイムアウト オブジェクトを設定します。

SetInterval は自動的に繰り返され、setTimeout は繰り返されません。

clearTimeout(object) は setTimeout オブジェクトをクリアします
clearInterval(object) は setInterval オブジェクトをクリアします

例を 2 つだけ挙げてみましょう。
例 1. フォームがトリガーまたはロードされると、文字列をそのまま出力します

コードをコピー コードは次のとおりです。


< head>

無題ドキュメント








例2. 入力ボックスにフォーカスがある場合は定期的に入力ボックスの情報を確認し、フォーカスが無い場合は確認動作を行わない。

コードをコピー コードは次のとおりです:




var Second=5000; //間隔時間 5 秒
var c =0;
functionscroll() {
c ;
if ("b" == document.activeElement.id) {
var str="スケジュールされたチェックセクション " c " Times
";
if(document.getElementByIdx_x_x('b').value!=""){
str ="入力ボックスの現在の内容は現在のコンテンツは
" document.getElementByIdx_x_x('b').value "";
}
document.getElementByIdx_x_x('word').innerHTML = str ;
}
}












例 3. 以下は最も単純な例です。タイマーが期限切れになった後に警告ウィンドウが表示されます。

コードをコピー コードは次のとおりです:




function count() {
document.getElementByIdx_x_x('m').innerHTML="タイマーが開始しました!";
setTimeout("alert(' 10 秒まで! < input TYPE="button" value=" タイミング開始" onclick="count()">





例 4: カウントダウン タイム ジャンプ


コードをコピー

コードは次のとおりです: My JSP 'ds04.jsp' 開始ページ< ;/ title></div> <span id="tiao">3</span><div class="codebody" id="code62781"> <a href="javascript:countDown"> </a>数秒後に自動的にジャンプします...<br> <meta http-equiv=refresh content=3;url= '/ds02.jsp'/><br> <!--スクリプトの開始--><br> <script language="javascript" type= ""><br>function countDown(secs){<br> tiao.innerText=secs;<br> if(--secs>0)<br> setTimeout("countDown(" secs ")",1000 ); <br> }<br> countDown(3);<br> </script><br> <!--スクリプトの終わり--><br> </head><br><br><br><br>例 6:<br> <br><br> </div> <br><br>コードをコピーします<p></p> <div class="codetitle"> コードは次のとおりです。<span><a style="CURSOR: pointer" data="44219" class="copybut" id="copybut44219" onclick="doCopy('code44219')"><u><head>メタ http-equiv="refresh" content="2;url='b.html'"> </u></head> </a>例 7:</span> </div> <div class="codebody" id="code44219"> <br><br><br>コードをコピー<br> </div> コードは次のとおりです:<p></p> <p><script language="javascript" タイプ="text /javascript"></p> <div class="codetitle"> setTimeout("window.location.href='b.html'", 2000);<span> //次の 2 つは両方とも使用できます<a style="CURSOR: pointer" data="26465" class="copybut" id="copybut26465" onclick="doCopy('code26465')"> //setTimeout( "javascript:location. href='b.html'", 2000);<u> //setTimeout("window.location='b.html'", 2000);</u></script></a> </span> </div> <div class="codebody" id="code26465">例 8:<br> <br><br><br><br><br>コードをコピー<br> </div> コードは次のとおりです:<p></p> <p><span id="totalSecond"> ;2< /span></p> <div class="codetitle"><script language="javascript" type="text/javascript"><span> var Second = document.getElementByIdx_x('totalSecond').innerHTML;<a style="CURSOR: pointer" data="53168" class="copybut" id="copybut53168" onclick="doCopy('code53168')"> if(isNaN( Second)) {<u> //...数値処理メソッドではありません</u> }else{</a> setInterval(function(){</span> document.getElementByIdx_x('totalSecond').innerHTML = --second; </div> if (2 番目 window.location = 'b.html';<br> }<br> }, 1000);<br> } <br></script><br><br><br> <br>js タイマー (1 回実行、繰り返し)<br> <br>JS コードの一部、JS タイマーの小さな例を共有します。これは、1 回実行されるタイマーと繰り返し実行されるタイマーに分かれています。初心者の方のご参考に。 <br> <br>1、1 回だけ実行されるタイマー <br> <br><br> </div> <p>コードをコピー</p> <p></p> コードは次のとおりです。<p></p> <p><script>タイマー非同期 Run </p> <div class="codetitle">function hello(){ <span>alert("hello"); <a style="CURSOR: pointer" data="73058" class="copybut" id="copybut73058" onclick="doCopy('code73058')">} <u>//メソッド名を使用してメソッドを実行します </u>var t1 = window.setTimeout(hello, 1000); </a>var t2 = window.setTimeout("hello()",3000);//文字列実行メソッドを使用します </span>window.clearTimeout(t1);//タイマーを削除します </div></script&gt ;<div class="codebody" id="code73058"> <br><br> <br>2、繰り返し実行用のタイマー<br> <br><br><br><br><br>コードをコピー<br><br> </div> コードは次のとおりです:<div class="codebody" id="code39946"> <br><script> <br>function hello(){ <br>alert("hello"); <br>} <br>//メソッド <br>var t1 = window を繰り返し実行します。 (hello,1000); <br>var t2 = window.setInterval("hello()",3000); <br>//タイマーを削除する方法 <br>window.clearInterval(t1); /script><br><br> </div> 備考: <p> </p>ページ内に 2 つのメソッドがあり、どちらもページが読み込まれた後に実行されますが、実際には順番に実行できない場合は、次のメソッドを参照して問題を解決できます。 onload メソッドの timer では、実行前に一定時間「遅延」するタイマーを設定します。これは、ページの読み込みとメソッドの実行の順序を区別するためと考えられます。 <p> <br></p> <p><br><br></p> <div class="codetitle"><span>コードをコピー<a style="CURSOR: pointer" data="39283" class="copybut" id="copybut39283" onclick="doCopy('code39283')"><u></u> コードは次のとおりです:</a><div class="codebody" id="code39283"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br><html xmlns="http://www.w3.org/1999/xhtml"><br><head runat="server"><br>    <title>Untitled Page</title> <p>    <script language="javascript" type="text/javascript"><br>    var YC = new Object();<br>    function beginYC()<br>    {<br>        var secondsYC = document.getElementById("txtYCSeconds").value;<br>        try<br>        { <br>            YC = setTimeout("alert('延迟"+secondsYC+"秒成功')",secondsYC*1000);<br>        }<br>        catch(e)<br>        {<br>            alert("请输入正确的秒数。");<br>        }<br>    }<br>    function overYC()<br>    {<br>        clearTimeout(YC);<br>        YC=null;<br>        alert("终止延迟成功。");<br>    }<br><br>/**************************↓↓↓↓定时器的使用↓↓↓↓********************************/<br><br>    var timerDS = new Object();<br>    var timerDDS = new Object();<br>    function beginDS()<br>    {<br>        sn.innerHTML = "0";<br>        timerDS = setInterval("addOne()",parseInt(document.getElementById("txtIntervalSeconds").value,10)*1000);<br>    }<br>    function goonDS()<br>    {<br>        timerDS = setInterval("addOne()",parseInt(document.getElementById("txtIntervalSeconds").value,10)*1000);<br>    }<br>    function overDS()<br>    {<br>        clearInterval(timerDS);<br>        timerDS=null;<br>    }<br>    function delayDS()<br>    {<br>        overDS();<br>        timerDDS = setTimeout("goonDS()",document.getElementById("txtDDSSeconds").value*1000);<br>    }<br>    function addOne()<br>    {<br>        if(sn.innerHTML=="10")<br>        {<br>            overDS();<br>            alert("恭喜你,已成功达到10秒");<br>            return;<br>        }<br>        sn.innerHTML=parseInt(sn.innerHTML,10)+1;<br>    }<br><br>    </script></p> <p></head><br><body><br>    <form id="form1" runat="server"><br>    <div><br>        延迟器的使用:</div><br>    <div><br>     <label id="Label2" title="延迟秒数:"></label><br>        <input type="text" id="txtYCSeconds" value="3" /><br>        <input type="button" id="btnBYC" onclick="javascript:beginYC()" value="开始延迟" /><br>        <input type="button" id="btnOYC" onclick="javascript:overYC()" value="终止延迟" /><br>        <input type="button" id="Button1" onclick="javascript:alert('good monrning');" value="普通弹窗" /><br>    </div><br>    <br /><br>    <div><br>        定时器的使用:</div><br>    <div><br>    <div id="sn">0</div><br> <label id="Label1" title="タイマー間隔秒:"></label><br> > btnODS" onclick="javascript:overDS()" value="終了タイミング" /> ;<br> <input type="button" id="btnGDS" onclick="javascript:goonDS()" value="継続タイミング " /><BR><BR> <label id="ds" title ="遅延秒数:"></label><br> ="5" /><br> div><br> </form><br></body><br></ html><br><br><br></p> </div></span></div> </div> </div> <div class="wzconShengming_sp"> <div class="bzsmdiv_sp">このウェブサイトの声明</div> <div>この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。</div> </div> </div> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="2507867629"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <div class="AI_ToolDetails_main4sR"> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3653428331" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796789525.html" title="Windows11 KB5054979の新しいものと更新の問題を修正する方法" class="phpgenera_Details_mainR4_bottom_title">Windows11 KB5054979の新しいものと更新の問題を修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785857.html" title="Atomfallのクレーンコントロールキーカードを見つける場所" class="phpgenera_Details_mainR4_bottom_title">Atomfallのクレーンコントロールキーカードを見つける場所</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796783009.html" title="アサシンクリードシャドウ - 鍛冶屋を見つけて武器と鎧のカスタマイズを解除する方法" class="phpgenera_Details_mainR4_bottom_title">アサシンクリードシャドウ - 鍛冶屋を見つけて武器と鎧のカスタマイズを解除する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796784440.html" title="<🎜>:Dead Rails-すべての課題を完了する方法" class="phpgenera_Details_mainR4_bottom_title"><🎜>:Dead Rails-すべての課題を完了する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> --> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットAIツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title"> <h3>Undresser.AI Undress</h3> </a> <p>リアルなヌード写真を作成する AI 搭載アプリ</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title"> <h3>AI Clothes Remover</h3> </a> <p>写真から衣服を削除するオンライン AI ツール。</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title"> <h3>Undress AI Tool</h3> </a> <p>脱衣画像を無料で</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title"> <h3>Clothoff.io</h3> </a> <p>AI衣類リムーバー</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173414504068133.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Video Face Swap" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_title"> <h3>Video Face Swap</h3> </a> <p>完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796789525.html" title="Windows11 KB5054979の新しいものと更新の問題を修正する方法" class="phpgenera_Details_mainR4_bottom_title">Windows11 KB5054979の新しいものと更新の問題を修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785857.html" title="Atomfallのクレーンコントロールキーカードを見つける場所" class="phpgenera_Details_mainR4_bottom_title">Atomfallのクレーンコントロールキーカードを見つける場所</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796783009.html" title="アサシンクリードシャドウ - 鍛冶屋を見つけて武器と鎧のカスタマイズを解除する方法" class="phpgenera_Details_mainR4_bottom_title">アサシンクリードシャドウ - 鍛冶屋を見つけて武器と鎧のカスタマイズを解除する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796784440.html" title="<🎜>:Dead Rails-すべての課題を完了する方法" class="phpgenera_Details_mainR4_bottom_title"><🎜>:Dead Rails-すべての課題を完了する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="メモ帳++7.3.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_title"> <h3>メモ帳++7.3.1</h3> </a> <p>使いやすく無料のコードエディター</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 中国語版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 中国語版</h3> </a> <p>中国語版、とても使いやすい</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ゼンドスタジオ 13.0.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_title"> <h3>ゼンドスタジオ 13.0.1</h3> </a> <p>強力な PHP 統合開発環境</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ドリームウィーバー CS6" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_title"> <h3>ドリームウィーバー CS6</h3> </a> <p>ビジュアル Web 開発ツール</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Mac版</h3> </a> <p>神レベルのコード編集ソフト(SublimeText3)</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>ホットトピック</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/gmailyxdlrkzn" title="Gmailメールのログイン入り口はどこですか?" class="phpgenera_Details_mainR4_bottom_title">Gmailメールのログイン入り口はどこですか?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>7626</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>15</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/cakephp-tutor" title="CakePHP チュートリアル" class="phpgenera_Details_mainR4_bottom_title">CakePHP チュートリアル</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1389</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>52</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/steamdzhmcssmgs" title="Steamのアカウント名の形式は何ですか" class="phpgenera_Details_mainR4_bottom_title">Steamのアカウント名の形式は何ですか</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>89</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>11</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/winactivationkeyper" title="Win11 Activation Key Permanent" class="phpgenera_Details_mainR4_bottom_title">Win11 Activation Key Permanent</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>70</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/newyorktimesdailybrief" title="NYTの接続はヒントと回答です" class="phpgenera_Details_mainR4_bottom_title">NYTの接続はヒントと回答です</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>31</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>140</span> </div> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/faq/zt">もっと見る</a> </div> </div> </div> </div> </div> <div class="Article_Details_main2"> <div class="phpgenera_Details_mainL4"> <div class="phpmain1_2_top"> <a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img src="/static/imghw/index2_title2.png" alt="" /></a> </div> <div class="phpgenera_Details_mainL4_info"> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/629494.html" title="JS と Baidu Maps を使用してマップ パン機能を実装する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/164/170053204074362.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JS と Baidu Maps を使用してマップ パン機能を実装する方法" /> </a> <a href="https://www.php.cn/ja/faq/629494.html" title="JS と Baidu Maps を使用してマップ パン機能を実装する方法" class="phphistorical_Version2_mids_title">JS と Baidu Maps を使用してマップ パン機能を実装する方法</a> <span class="Articlelist_txts_time">Nov 21, 2023 am 10:00 AM</span> <p class="Articlelist_txts_p">JS と Baidu Map を使用してマップ パン機能を実装する方法 Baidu Map は広く使用されている地図サービス プラットフォームで、Web 開発で地理情報、位置情報、その他の機能を表示するためによく使用されます。この記事では、JS と Baidu Map API を使用してマップ パン機能を実装する方法と、具体的なコード例を紹介します。 1. 準備 Baidu Map API を使用する前に、Baidu Map Open Platform (http://lbsyun.baidu.com/) で開発者アカウントを申請し、アプリケーションを作成する必要があります。作成完了</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/734386.html" title="推奨: 優れた JS オープンソースの顔検出および認識プロジェクト" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/171211651392093.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="推奨: 優れた JS オープンソースの顔検出および認識プロジェクト" /> </a> <a href="https://www.php.cn/ja/faq/734386.html" title="推奨: 優れた JS オープンソースの顔検出および認識プロジェクト" class="phphistorical_Version2_mids_title">推奨: 優れた JS オープンソースの顔検出および認識プロジェクト</a> <span class="Articlelist_txts_time">Apr 03, 2024 am 11:55 AM</span> <p class="Articlelist_txts_p">顔の検出および認識テクノロジーは、すでに比較的成熟しており、広く使用されているテクノロジーです。現在、最も広く使用されているインターネット アプリケーション言語は JS ですが、Web フロントエンドでの顔検出と認識の実装には、バックエンドの顔認識と比較して利点と欠点があります。利点としては、ネットワーク インタラクションの削減とリアルタイム認識により、ユーザーの待ち時間が大幅に短縮され、ユーザー エクスペリエンスが向上することが挙げられます。欠点としては、モデル サイズによって制限されるため、精度も制限されることが挙げられます。 js を使用して Web 上に顔検出を実装するにはどうすればよいですか? Web 上で顔認識を実装するには、JavaScript、HTML、CSS、WebRTC など、関連するプログラミング言語とテクノロジに精通している必要があります。同時に、関連するコンピューター ビジョンと人工知能テクノロジーを習得する必要もあります。 Web 側の設計により、次の点に注意してください。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/633499.html" title="株価分析に必須のツール: PHP と JS を使用してローソク足チャートを描画する手順を学びます" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/465/014/170281051584846.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="株価分析に必須のツール: PHP と JS を使用してローソク足チャートを描画する手順を学びます" /> </a> <a href="https://www.php.cn/ja/faq/633499.html" title="株価分析に必須のツール: PHP と JS を使用してローソク足チャートを描画する手順を学びます" class="phphistorical_Version2_mids_title">株価分析に必須のツール: PHP と JS を使用してローソク足チャートを描画する手順を学びます</a> <span class="Articlelist_txts_time">Dec 17, 2023 pm 06:55 PM</span> <p class="Articlelist_txts_p">株式分析に必須のツール: PHP および JS でローソク足チャートを描画する手順を学びます。特定のコード例が必要です。インターネットとテクノロジーの急速な発展に伴い、株式取引は多くの投資家にとって重要な方法の 1 つになりました。株価分析は投資家の意思決定の重要な部分であり、ローソク足チャートはテクニカル分析で広く使用されています。 PHP と JS を使用してローソク足チャートを描画する方法を学ぶと、投資家がより適切な意思決定を行うのに役立つ、より直感的な情報が得られます。ローソク足チャートとは、株価をローソク足の形で表示するテクニカルチャートです。株価を示しています</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/633266.html" title="PHP と JS を使用して株価ローソク足チャートを作成する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/170277173527364.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP と JS を使用して株価ローソク足チャートを作成する方法" /> </a> <a href="https://www.php.cn/ja/faq/633266.html" title="PHP と JS を使用して株価ローソク足チャートを作成する方法" class="phphistorical_Version2_mids_title">PHP と JS を使用して株価ローソク足チャートを作成する方法</a> <span class="Articlelist_txts_time">Dec 17, 2023 am 08:08 AM</span> <p class="Articlelist_txts_p">PHP と JS を使用して株のローソク足チャートを作成する方法。株のローソク足チャートは、株式市場で一般的なテクニカル分析グラフィックです。始値、終値、最高値、株価などのデータを描画することで、投資家が株式をより直観的に理解するのに役立ちます。株価の最低価格、価格変動。この記事では、PHP と JS を使用して株価のローソク足チャートを作成する方法を、具体的なコード例とともに説明します。 1. 準備 開始する前に、次の環境を準備する必要があります。 1. PHP を実行するサーバー 2. HTML5 および Canvas をサポートするブラウザー 3</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/629525.html" title="JSと百度地図を使って地図クリックイベント処理機能を実装する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/164/170053627491331.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JSと百度地図を使って地図クリックイベント処理機能を実装する方法" /> </a> <a href="https://www.php.cn/ja/faq/629525.html" title="JSと百度地図を使って地図クリックイベント処理機能を実装する方法" class="phphistorical_Version2_mids_title">JSと百度地図を使って地図クリックイベント処理機能を実装する方法</a> <span class="Articlelist_txts_time">Nov 21, 2023 am 11:11 AM</span> <p class="Articlelist_txts_p">JS と Baidu Maps を使用してマップ クリック イベント処理を実装する方法の概要: Web 開発では、地理的位置と地理情報を表示するためにマップ関数を使用することが必要になることがよくあります。マップ上のクリック イベント処理は、マップ機能の一般的に使用される重要な部分です。この記事では、JS と Baidu Map API を使用して地図のクリック イベント処理機能を実装する方法と、具体的なコード例を紹介します。手順: Baidu Map の API ファイルをインポートします。まず、Baidu Map API のファイルを HTML ファイルにインポートします。これは、次のコードによって実現できます。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/629475.html" title="JSとBaidu Mapsを使ってマップヒートマップ機能を実装する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/170053040496360.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JSとBaidu Mapsを使ってマップヒートマップ機能を実装する方法" /> </a> <a href="https://www.php.cn/ja/faq/629475.html" title="JSとBaidu Mapsを使ってマップヒートマップ機能を実装する方法" class="phphistorical_Version2_mids_title">JSとBaidu Mapsを使ってマップヒートマップ機能を実装する方法</a> <span class="Articlelist_txts_time">Nov 21, 2023 am 09:33 AM</span> <p class="Articlelist_txts_p">JS と Baidu Maps を使用してマップ ヒート マップ機能を実装する方法 はじめに: インターネットとモバイル デバイスの急速な発展に伴い、マップは一般的なアプリケーション シナリオになりました。視覚的な表示方法として、ヒート マップはデータの分布をより直観的に理解するのに役立ちます。この記事では、JS と Baidu Map API を使用してマップ ヒート マップ機能を実装する方法と、具体的なコード例を紹介します。準備作業: 開始する前に、次の項目を準備する必要があります: Baidu 開発者アカウント、アプリケーションの作成、対応する AP の取得</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/633755.html" title="PHP および JS 開発のヒント: 株価ローソク足チャートの描画方法をマスターする" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/170288520192764.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP および JS 開発のヒント: 株価ローソク足チャートの描画方法をマスターする" /> </a> <a href="https://www.php.cn/ja/faq/633755.html" title="PHP および JS 開発のヒント: 株価ローソク足チャートの描画方法をマスターする" class="phphistorical_Version2_mids_title">PHP および JS 開発のヒント: 株価ローソク足チャートの描画方法をマスターする</a> <span class="Articlelist_txts_time">Dec 18, 2023 pm 03:39 PM</span> <p class="Articlelist_txts_p">インターネット金融の急速な発展に伴い、株式投資を選択する人がますます増えています。株式取引では、ローソク足チャートは一般的に使用されるテクニカル分析手法であり、株価の変化傾向を示し、投資家がより正確な意思決定を行うのに役立ちます。この記事では、PHP と JS の開発スキルを紹介し、株価ローソク足チャートの描画方法を読者に理解してもらい、具体的なコード例を示します。 1. 株のローソク足チャートを理解する 株のローソク足チャートの描き方を紹介する前に、まずローソク足チャートとは何かを理解する必要があります。ローソク足チャートは日本人が開発した</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/629514.html" title="JSとBaidu Mapsを使って地図ポリゴン描画機能を実装する方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/465/014/170053520228035.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JSとBaidu Mapsを使って地図ポリゴン描画機能を実装する方法" /> </a> <a href="https://www.php.cn/ja/faq/629514.html" title="JSとBaidu Mapsを使って地図ポリゴン描画機能を実装する方法" class="phphistorical_Version2_mids_title">JSとBaidu Mapsを使って地図ポリゴン描画機能を実装する方法</a> <span class="Articlelist_txts_time">Nov 21, 2023 am 10:53 AM</span> <p class="Articlelist_txts_p">JS と Baidu Maps を使用して地図ポリゴン描画機能を実装する方法 現代の Web 開発において、地図アプリケーションは一般的な機能の 1 つになっています。地図上にポリゴンを描画すると、ユーザーが表示および分析できるように特定のエリアをマークするのに役立ちます。この記事では、JS と Baidu Map API を使用して地図ポリゴン描画機能を実装する方法と、具体的なコード例を紹介します。まず、Baidu Map API を導入する必要があります。次のコードを使用して、Baidu Map API の JavaScript を HTML ファイルにインポートできます。</p> </div> </div> <a href="https://www.php.cn/ja/web-designer.html" class="phpgenera_Details_mainL4_botton"> <span>See all articles</span> <img src="/static/imghw/down_right.png" alt="" /> </a> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img src="/static/imghw/logo.png" alt=""> <p>福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!</p> </div> <div class="footermid"> <a href="https://www.php.cn/ja/about/us.html">私たちについて</a> <a href="https://www.php.cn/ja/about/disclaimer.html">免責事項</a> <a href="https://www.php.cn/ja/update/article_0_1.html">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1745255998"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' /> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <script> // top layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); document.addEventListener("DOMContentLoaded", (event) => { // 定义一个函数来处理滚动链接的点击事件 function setupScrollLink(scrollLinkId, targetElementId) { const scrollLink = document.getElementById(scrollLinkId); const targetElement = document.getElementById(targetElementId); if (scrollLink && targetElement) { scrollLink.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认链接行为 targetElement.scrollIntoView({ behavior: "smooth" }); // 平滑滚动到目标元素 }); } else { console.warn( `Either scroll link with ID '${scrollLinkId}' or target element with ID '${targetElementId}' not found.` ); } } // 使用该函数设置多个滚动链接 setupScrollLink("Article_Details_main1L2s_1", "article_main_title1"); setupScrollLink("Article_Details_main1L2s_2", "article_main_title2"); setupScrollLink("Article_Details_main1L2s_3", "article_main_title3"); setupScrollLink("Article_Details_main1L2s_4", "article_main_title4"); setupScrollLink("Article_Details_main1L2s_5", "article_main_title5"); setupScrollLink("Article_Details_main1L2s_6", "article_main_title6"); // 可以继续添加更多的滚动链接设置 }); window.addEventListener("scroll", function () { var fixedElement = document.getElementById("Article_Details_main1Lmain"); var scrollTop = window.scrollY || document.documentElement.scrollTop; // 兼容不同浏览器 var clientHeight = window.innerHeight || document.documentElement.clientHeight; // 视口高度 var scrollHeight = document.documentElement.scrollHeight; // 页面总高度 // 计算距离底部的距离 var distanceToBottom = scrollHeight - scrollTop - clientHeight; // 当距离底部小于或等于300px时,取消固定定位 if (distanceToBottom <= 980) { fixedElement.classList.remove("Article_Details_main1Lmain"); fixedElement.classList.add("Article_Details_main1Lmain_relative"); } else { // 否则,保持固定定位 fixedElement.classList.remove("Article_Details_main1Lmain_relative"); fixedElement.classList.add("Article_Details_main1Lmain"); } }); </script> </body> </html>