[英]How to change a jquery snippet to output a second element?
I am using the following code to show a "follow me" box to the left of my site. 我正在使用以下代码在我的网站左侧显示一个“跟随我”框。
I'd like to create a second button, right underneath this button that sent people who clicked it to an RSS link. 我想在该按钮的正下方创建第二个按钮,该按钮将单击它的人发送到RSS链接。
How could I do this? 我该怎么办?
Thanks!, Azeem 谢谢!,Azeem
<!-- by Twitter Follow Me Box v1.1 -->
<script type=\"text/javascript\">
//<![CDATA[
jQuery(document).ready(function(){
jQuery(\"body\").append(\"<div id=\\\"tfmBox\\\"></div>\");
jQuery(\"#tfmBox\").css({'position' : 'fixed', 'top' : '$top', 'width' : '30px', 'height' : '119px', 'z-index' : '1000', 'cursor' : 'pointer', 'background' : '#$color url(" . WP_PLUGIN_URL . "/twitter-follow-me-box/follow-me.png) no-repeat scroll $imagem_side top', '$side' : '0'});
jQuery(\"#tfmBox\").click(function () {
window.open('http://twitter.com/$twitter_account/');
});
});
//]]>
</script>
<!-- /by Twitter Follow Me Box -->
The very same way, you just have to change the URL adress to your RSS channel. 同样,您只需将URL地址更改为RSS频道。 Of course, you have to set 'top' CSS-property with different PHP variable.
当然,您必须使用不同的PHP变量设置“顶级” CSS属性。 I'm not sure how $top looks like, but I guess it's with 'px' at the end:
我不确定$ top的样子,但是我猜它的末尾是'px':
$rssButtTop = substr($top,-3) + 119 + 5; //span is 5
This has to be in the PHP section of code. 这必须在代码的PHP部分中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.