我有一个隐藏的联系人表单,这是部署在一个按钮上。它的字段被设置为CSS背景图像,并且它们总是比已切换的div显示稍晚一点。
我在<head>
部分使用了这段代码,但没有成功(在我清除缓存之后):
<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作为我的库,如果我也可以使用它来安排这个问题,那就太酷了。
谢谢你的想法。
https://stackoverflow.com/questions/1373142
复制相似问题