我想要一个按钮显示为图像并打开时间选择器
我想在我的时间选择器中包含一个按钮,这样如果用户单击该按钮,就会显示时间选择器。这可行,但我希望按钮显示为图像而不是按钮,但我不知道该怎么做。下面是我现在的代码:
$('#durationpicker').trenttimepicker({
timeFormat:'hh mm ss',
hourGrid: 4,
minuteGrid: 10,
secondGrid: 10,
showOn: 'button',
button: '.timepicker_button_trigger'});
});
我想要显示的图像是:Images/clock.gif
,我将其包含在 html 代码中,但它同时显示按钮和图像,其中按钮显示时间选择器和图像什么都不做。
<p>
<strong>3: Duration:</strong>
<input type="text" id="durationpicker" name="durationChosen" readonly="readonly" />
<span class="timepicker_button_trigger">
<img src="Images/clock.gif" alt="Choose Duration" />
</span>
</p>
有谁知道如何将按钮显示为图像并能够使用它来显示时间选择器?
该时间选择器是 trent richardson 的时间选择器,可以在此处查看,
谢谢
I want to include a button with my timepicker so that if the user clicks on the button, the timepicker is displayed. This works but I want the button to be displayed as an image rather than a button but I do not know how to do this. Below is my code at moment:
$('#durationpicker').trenttimepicker({
timeFormat:'hh mm ss',
hourGrid: 4,
minuteGrid: 10,
secondGrid: 10,
showOn: 'button',
button: '.timepicker_button_trigger'});
});
The image I want to be displayed is : Images/clock.gif
and I include it in html code but it displsys both button and image with the button displaying the timepicker and the image doing nothing.
<p>
<strong>3: Duration:</strong>
<input type="text" id="durationpicker" name="durationChosen" readonly="readonly" />
<span class="timepicker_button_trigger">
<img src="Images/clock.gif" alt="Choose Duration" />
</span>
</p>
Does anyone know how to display the button as an image and be able to use it to display the timepicker?
The timepicker is trent richardson's timepicker which can be viewed here
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用 CSS 来设置按钮的样式。将按钮的
background-image
css 属性设置为图像。然后调整按钮的大小,通过 css 删除所有其他样式,然后就可以开始了。这会给你一些开始的东西。 http://snipplr.com/view/14261/
You'll have to use CSS to style the button. Set the
background-image
css property of the button to be the image. Then resize the button, remove all the other styling from it via css, and you're good to go.This will give you something to start with. http://snipplr.com/view/14261/