我有一个隐藏的联系表单,点击按钮后会展开。它的字段被设置为CSS背景图像,并且它们总是比已切换的div稍晚出现。
我曾经在部分中使用这个代码片段,但是没有成功(即使我清除了缓存):
<script>
$(document).ready(function() {
pic = new Image();
pic2 = new Image();
pic3 = new Image();
pic.src="<?php bloginfo('template_directory'); ?>/images/inputs/input1.png";
pic2.src="<?php bloginfo('template_directory'); ?>/images/inputs/input2.png";
pic3.src="<?php bloginfo('template_directory'); ?>/images/inputs/input3.png";
});
</script>
我使用jQuery作为我的库,如果我能用它来解决这个问题就太棒了。
谢谢你的建议。