Making a link object disappear or invisible when you click on it.

Hi All, I cant for the life of me figure this out and im sure its simple. I have object links in various colours e.g 1){object:Berry1} and if a player clicks on it he has 3 verb options look at, take and eat. Now if the player chooses the eat option i want this object link to disappear. I know i can do it in a menu style but then he does not have the verb options and cant eat it as such. He can only click on it defeating the purpose.

I even tried destroy name, object link etc but it only put the color back to default black on the link.

Hope im making sense here. Hope someone can help.


Do you mean you want the object link to disappear entirely, rather than just becoming not a link?

You could try:

JS.eval("$('.elementmenu').each(function () { if ($(this).data('elementid') == 'Berry1') {$(this).remove();}});")

Should remove all links to that object.

If you only want to remove a specific link, you'd need some way to specify which one you mean; putting it in a span with some class ID would probably work.


Yes thanks mrangel, that's exactly it. It removes the link completely. Thats all i wanted but did not realize it was not that simple. I don't do the whole JS thing so thanks again. Now i can carry on...


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums