我使用非常简单的功能在单击时隐藏整个 div 并显示评论块。
我需要做的不是隐藏整个div,而是在单击时保持原样,显示注释块,但是将跨度中的类从class =“icon expand”更改为class =“icon abate”并仅隐藏“单击在这里发表评论或查看我们的客户在说什么。” 行,以便如果再次单击它会做相反的事情。
这是我的脚本
function myfunc_showComments() {
if ( typeof jQuery != 'undefined' ) {
$('#hidecomments').remove();
}
var commentsParams ={
categoryID: 'Widgets',
streamID: '<?php echo $streamID ?>',
containerID: 'commentsDiv',
}
gigya.services.socialize.showCommentsUI(conf,commentsParams);
}
</script>
<!-- end #review --></div>
<div id="hidecomments">
<div class="button_3" onClick="myfunc_showComments()"><span class="icon expand"></span><h2>Comment & Rate this <span><?php echo $widget_title ?></span></h2><br />Click here to leave a comment or view what our customers are saying.
</div>
</div>
任何建议或帮助都非常受欢迎