Hide effect for similar topics script
2 posters
Page 1 of 1
Hide effect for similar topics script
Hi,
I'm using this script from @Ange Tuteur and it works great:
http://fmdesign.forumotion.com/t240-display-similar-topics-on-creation-of-a-new-topic
But now I want something similar to a spoiler/toggle/hide effect for this script. Through this effect it should be possible to show or hide the display for similar topics.
Anyone know how to edit this script for phpbb3?
Thanks in advance.
I'm using this script from @Ange Tuteur and it works great:
http://fmdesign.forumotion.com/t240-display-similar-topics-on-creation-of-a-new-topic
But now I want something similar to a spoiler/toggle/hide effect for this script. Through this effect it should be possible to show or hide the display for similar topics.
Anyone know how to edit this script for phpbb3?
Thanks in advance.
Simone Boi likes this post
Re: Hide effect for similar topics script
Hi @darki,
Try replacing the script with this :
Should be hidden by default, and to show it just click the title.
Try replacing the script with this :
- Code:
/\?f=\d+&mode=newtopic/.test(window.location.search) && $(function() {
var s = document.getElementsByTagName('INPUT'),i, b;
for (i=0; i<s.length; i++) {
if (/subject/.test(s[i].name)) {
var d = document.createElement('DIV');
d.innerHTML = '<div id="similarToggle" class="h3">Show Similar Topics</div><div id="topicSimilar" style="display:none">No similar topics..</div>';
s[i].parentNode.appendChild(d);
s[i].onkeyup = function() {
if (this.value.length > 3) $('#topicSimilar').load('/search?search_keywords='+encodeURIComponent(this.value)+' a.topictitle', function() {
$(this).find('a').attr({'target' : '_blank', 'style' : 'display:block'});
});
else $('#topicSimilar').html('No similar topics..');
};
b = document.getElementById('similarToggle');
b.style.cursor = 'pointer';
b.onclick = function() {
var box = document.getElementById('topicSimilar');
if (/none/.test(box.style.display)) {
box.style.display = 'block';
this.innerHTML = 'Hide Similar Topics';
} else {
box.style.display = 'none';
this.innerHTML = 'Show Similar Topics';
}
};
break;
}
}
});
Should be hidden by default, and to show it just click the title.
Simone Boi likes this post
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum