我有一个隐藏的联系表单,单击按钮部署.它的字段设置为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>
Run Code Online (Sandbox Code Playgroud)
我正在使用jQuery作为我的库,如果我能用它来安排这个问题,那将会很酷.
谢谢你的支持.
我有这个小脚本来点击按钮时切换联系表格:
$(document).ready(function(){
$("#button").click(function () {
$("#form").toggle("slow");
});
});
Run Code Online (Sandbox Code Playgroud)
一切都在Firefox中运行正常,但在IE中,似乎切换的淡入效果不会100%完成,并且文本在完整渲染之前被"冻结",失去了所有精细分辨率.
我读了这个主题,但我不确切知道如何将它应用到我的问题.
谢谢你的帮助.
我想知道如何只切换一个"子"div,点击一个重复html的按钮,如下所示:
<div class="button">
<div class="hide toggle">
Blah1
</div>
</div>
<div class="button">
<div class="hide toggle">
Blah2
</div>
</div>
<div class="button">
<div class="hide toggle">
Blah3
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
目标是仅影响中级子div,并保持隐藏其余部分.
我不知道是否有可能.
这段代码正在切换我所有的div:
<script type="text/javascript">
$(document).ready(function(){
$('.button').click(function() {
$('.toggle').slideToggle();
}, function () {
$('.toggle').slideToggle();
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
非常感谢您的帮助.
我有一个带背景的div,我想在点击时改变背景的位置.
这是我的jQuery片段:
$('#sprite').click(function() {
$(this).css('backgroundPosition','-40px');
});
Run Code Online (Sandbox Code Playgroud)
虽然这工作正常,但我想通过"第二次"点击返回到原始位置,重置所有.
嗯,这就是所谓的"回调"吗?
我试过这样但它不起作用:
$('#sprite').click(function() {
$(this).css('backgroundPosition','-40px');
},
function() {
$(this).css('backgroundPosition','40px');
}
);
Run Code Online (Sandbox Code Playgroud)
谢谢你的任何信息.
我有一个联系表单,其中电子邮件实际上可以在源中访问,因为我正在使用cgi文件来处理它.我担心的是邮件抓取工具,我想知道这是否是禁止的,我应该切换到另一种更安全的形式.或者,如果有一些技巧可以"混淆"爬虫?谢谢你的想法.
我正在测试一个PHP邮件表单,一个非常准确的邮件表单,在这里找到:
<?php
if(isset($_POST['submit']))
{
//The form has been submitted, prep a nice thank you message
$output = '<h3>Thanks for your message</h3>';
//Deal with the email
$to = 'mymail@mail.com';
$subject = 'you have a mail';
$contactname = strip_tags($_POST['contactname']);
$adress = strip_tags($_POST['adress']);
$contactemail = strip_tags($_POST['contactemail']);
$textmessage = strip_tags($_POST['textmessage']);
$boundary =md5(date('r', time()));
$headers = "From: My Site\r\nReply-To: webmaster@mysite.com";
$message = "Name: ".$contactname."\n";
$message .= "Adress: ".$adress."\n";
$message .= "E-mail: ".$contactemail."\n";
$message .= "Message: ".$textmessage."\n";
mail($to, $subject, $message, $headers);
}
?>
Run Code Online (Sandbox Code Playgroud)
问题是我每次在邮件中写一个单引号或双引号时都会收到一个不需要的斜杠"\",所以"我"在我的邮箱中显示为"我是". …
jquery ×3
css ×2
email ×2
toggle ×2
background ×1
cleartype ×1
encode ×1
html ×1
image ×1
php ×1
preload ×1
preloader ×1
togglebutton ×1
web-crawler ×1