MyBB Community Forums

Full Version: ID's problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi again, well, I'm trying to create some effects on the postbit_classic.

It's something simple... I put some font icons with a simple title, and, when you click on them, a specific information appears/dissappears sliding down/up with jQuery.

The effect works good but, when you click, this "specific information" slides in all the users. Searching, I read something that says every "slide" with the content needs a unique ID (or something like that) for each user.

I don't know how to do that, and less if this is right, so again, I'm asking help.

First, the html:

<div class="pbmenu">
<i id="stats" class="fa fa-bar-chart-o fa-lg" title="Stats"></i>&nbsp;&nbsp;&nbsp;
<i id="social" class="fa fa-bookmark fa-lg" title="Social"></i>&nbsp;&nbsp;&nbsp;
<i id="options" class="fa fa-gear fa-lg" title="Options"></i>
<ul class="est">
<br />
Posts: 100
</ul>
</div>

pbmenu it's a simple line who contains the 3 font icons. the "ul" thing is for the hidden content what I wanna show only for that specific user (Because I wanna show all your messages, and related information), and I don't want to slide another time in the same page in another post.

<script type="text/javascript">
jQuery.noConflict();
jQuery(function(){
	jQuery("#stats").click(function(event) {
	event.preventDefault();
	jQuery(".est").slideToggle();
});
jQuery(".est").click(function(event) {
	event.preventDefault();
	jQuery(".est").slideUp();
});
});
</script>

This is the short jQuery I'm using, it's very simple...

So please, if anyone can help me to do this, I appreciate your help a lot.

Greetings.

P.D.: Sorry again for my bad english. Tell me if you don't understand something.
You've to add a unique ID to trigger the element and then uses the same trigger to show the menu you want. e.g. add _{$post['uid']} at the end of your trigger element.
Hi Yaldaram, don't know how to do that. I put the "_{$post['uid']}" with the "est" class (I think that goes there) but don't work.