我应该使用哪些语言来允许用户在网页上增加或减少图像大小?

时间:2022-09-23 18:08:13

I am interested in having +/- buttons to increase and decrease the size of an image. What programming languages could I use, and what would be the pros/cons for using each one? I apologize for my incredibly novice questions.

我有兴趣使用+/-按钮来增加和减小图像的大小。我可以使用哪些编程语言,使用每种编程语言的优缺点是什么?我为我难以置信的新手问题道歉。

1 个解决方案

#1


0  

Bored, so I decided to build this simple stuff for ya! Please buy be a beer. HTML:

无聊,所以我决定为你建造这个简单的东西!请买一杯啤酒。 HTML:

    <img src="http://camcimcumcem.com/tphotos/5001_10000/Square-4.jpg"><br>
    <span id="plus">+</span><br>
    <span id="minus">-</span>

Script:

$("#plus").click(function(){
    $("img").css({"height": "+=50px", "width": "+=50px"});
})

$("#minus").click(function(){
    $("img").css({"height": "-=50px", "width": "-=50px"});
})

DEMO

#1


0  

Bored, so I decided to build this simple stuff for ya! Please buy be a beer. HTML:

无聊,所以我决定为你建造这个简单的东西!请买一杯啤酒。 HTML:

    <img src="http://camcimcumcem.com/tphotos/5001_10000/Square-4.jpg"><br>
    <span id="plus">+</span><br>
    <span id="minus">-</span>

Script:

$("#plus").click(function(){
    $("img").css({"height": "+=50px", "width": "+=50px"});
})

$("#minus").click(function(){
    $("img").css({"height": "-=50px", "width": "-=50px"});
})

DEMO