0

我想在我的时间选择器中包含一个按钮,这样如果用户单击该按钮,就会显示时间选择器。这可行,但我希望按钮显示为图像而不是按钮,但我不知道该怎么做。以下是我目前的代码:

$('#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>

有谁知道如何将按钮显示为图像并能够使用它来显示时间选择器?

timepicker 是 trent richardson 的 timepicker,可以在这里查看

谢谢

4

1 回答 1

0

您必须使用 CSS 来设置按钮样式。将background-image按钮的 css 属性设置为图像。然后调整按钮的大小,通过 css 从中删除所有其他样式,一切顺利。

这将为您提供一些开始。http://snipplr.com/view/14261/

于 2011-12-15T00:26:52.833 回答