https://teratail.com/questions/95471?whotofollow=
で、javasriptでスタイルを変更することには成功しましたが、変数を混ぜるためにはどうすればよいでしょうか?
html
1 <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> 2 <script src="style.js"></script> 3 <a id="picture1"><img src="gazou.png" id="img1" class="menu" ></a> 4 5
javascript
1$(function () { 2 // 画面幅 3 var W=screen.width; 4 // 画面高 5 var H=screen.height; 6 $("#img1").css({ 7 position: "absolute", 8 top : "H/10px", 9 left : "W/10px", 10 width : "W/10px" 11 }); 12 13 });
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/10/08 19:50