JavaScriptを使用してクライアント側の画像マップを作成するにはどうすればよいですか?
JavaScriptを使用してクライアント側の画像マップを作成します。クライアント側の画像マップは、タグのusemap属性によって有効になり、特別な
マップを形成する画像は、通常どおり要素を使用してページに挿入されますが、 usemapという追加の属性が含まれている点が異なります。 。 usemap属性の値は、
次のコードを実行して、クライアント側の画像マップを作成してみてください-
<html>
<head>
<title>Using JavaScript Image Map</title>
<script type="text/javascript">
<!--
function showTutorial(name) {
document.myform.stage.value = name
}
//-->
</script>
</head>
<body>
<form name="myform">
<input type = "text" name = "stage" size = "20" />
</form>
<!-- Create Mappings -->
<img src="/images/usemap.gif" alt="HTML Map" border="0" usemap="#tutorials"/>
<map name="tutorials">
<area shape="poly"
coords="74,0,113,29,98,72,52,72,38,27"
href="/perl/index.htm" alt="Perl Tutorial"
target="_self"
onMouseOver="showTutorial('perl')"
onMouseOut="showTutorial('')"/>
<area shape="rect"
coords="22,83,126,125"
href="/html/index.htm" alt="HTML Tutorial"
target="_self"
onMouseOver="showTutorial('html')"
onMouseOut="showTutorial('')"/>
<area shape="circle"
coords="73,168,32"
href="/php/index.htm" alt="PHP Tutorial"
target="_self"
onMouseOver="showTutorial('php')"
onMouseOut="showTutorial('')"/>
</map>
</body>
</html> -
CSSとJavaScriptを使用してタブ付きの画像ギャラリーを作成するにはどうすればよいですか?
以下は、CSSとJavaScriptを使用してタブ付きの画像ギャラリーを作成するためのコードです- 例 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> * { box-sizing: border-box; } h1 { text-align: center; } .ImgTh
-
JavaScriptでシンタックスハイライトを作成して使用するにはどうすればよいですか?
構文highligherを作成して使用するには、コードは次のとおりです- 例 <!DOCTYPE html> <html> <head> <style> body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .colorLinks { color: rgb(131, 44, 212