简体   繁体   English

用javascript,HTML5中的水平线替换按钮

[英]Replace Button with horizontal line in javascript, Html5

I am using one input button for hide and show image div and Using html5, jquery, Css3. 我正在使用一个输入按钮来隐藏和显示图像div,并使用html5,jquery,Css3。 But right now i want to replace button with one horizontal line. 但是现在我想用一条水平线代替按钮。 Whenever move point in line then button is triggered. 只要移动点在行中,就会触发按钮。

Right now i have normal button, I am showing in below image: 现在我有普通按钮,我在下图中显示: 在此处输入图片说明

But i want one line replace of this button like below image 但是我想要一行替换此按钮,如下图所示 在此处输入图片说明

I am using three image div and after click on rotate but it is showing next image div. 我正在使用三个图像div,然后单击“旋转”,但它显示了下一个图像div。


switchVisible() is a function for show and hide of image. switchVisible()是用于显示和隐藏图像的函数。
I don't have any about this please give me some idea. 我对此没有任何意见,请给我一些想法。

I am using this button code: 我正在使用此按钮代码:

<input id="Button1" type="button" value="Rotate" onclick="switchVisible();"/>

You can use j query.ui slider for your line to switch between images. 您可以为行使用j query.ui滑块在图像之间进行切换。

something like this: 像这样的东西:

$("#imageLine").slider({
    value: 0,
    orientation: "horizontal",
    range: "min",
    animate: true,
    stop: function( event, ui ) {
        //you can detect where ui.slider stops here
        console.log(ui.value)

        //and run your function then
        switchVisible(ui.value);
    }
});

function switchVisible(){
     ...your logic for displaying images depending on ui.slider position
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM