[英]Simple javascript for wordpress plugin
I am busy with a wordpress site.我正忙于 wordpress 站点。 I am using a plugin called wp-imageflow2, it uses the discription of the image when its upload to make a link, from what I gathered it looks for http to make a link.
我正在使用一个名为 wp-imageflow2 的插件,它在上传时使用图像的描述来建立链接,根据我收集的内容,它会寻找 http 来建立链接。 I need the images to link to a mailto tag.
我需要将图像链接到 mailto 标签。
So far I have a link to a html page in the description of the imageflow.到目前为止,我在图像流的描述中有一个指向 html 页面的链接。 Within the html page I have the code below.
在 html 页面中,我有以下代码。 It works fine except it uses the html link in the address bar.
它工作正常,只是它使用地址栏中的 html 链接。 How would I first create a new tab, open the email address in the email client and with a delay close the new tab.
我将如何首先创建一个新选项卡,在 email 客户端中打开 email 地址并延迟关闭新选项卡。 That should leave you on your original page.
那应该让您留在原始页面上。 Is this possible?
这可能吗?
<script>
function myFunc(){
location.href="mailto:name@name.co.za";
window.open('newwindow', config='height=50, width=50')
window.setTimeout("window.close()", 1000);
}
</script>
</head>
<body onload="myFunc();">
</body>
wp-imageflow2.php row 227 wp-imageflow2.php 行 227
if (($link == 'true') && (substr($attachment->post_content,0,7) == 'http://')) $linkurl = $attachment->post_content;
just add a few more lines here:只需在此处添加几行:
else if (($link == 'true') && (substr($attachment->post_content,0,8) == 'https://')) $linkurl = $attachment->post_content;
else if (($link == 'true') && (substr($attachment->post_content,0,7) == 'mailto:')) $linkurl = $attachment->post_content;
else if (($link == 'true') && (substr($attachment->post_content,0,6) == 'ftp://')) $linkurl = $attachment->post_content;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.