Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have created a custom menu function in functions.php, but I need to execute it in a container that is created by a javascript. Is this doable? The js is outputting a container called "album-info-text" that i'd like to replace the content of with my menu. This is the code that (I think) is outputting this container.

out += '<div class="slider-album-indicator">';
out += '<div class="album-info-text">'+
'<a href="javascript:void(0);" title="Info" class="album-name-indicator underlined"></a>'+
'<span class="item-count-indicator"></span>'+
'</div>';
out += '</div>';
out += '</div>';

I tried to change it to: out += ''; out += '' out += ''; out += '';

but that didn't work. jp_gMenu() is my custom menu function btw. As you can probably tell I don't really know what I'm doing with Javascript. I doubt what I'm trying to do is even legal, but if I put the function in the page template and then use css to move its container into position the links don't work.

share|improve this question
It's hard to tell what you're asking, I think your problem is related to JavaScript and that is considered off-topic. – Wyck Mar 29 at 5:44
1  
I don't know if its off-topic, but I know I'd like to see more code before answering. Ideally to see where you're using your function, and what it outputs. I think you will end up having to use jQuery to replace that 'album-info-text' element with your menu, so make sure your menu has a targetable container. – Mere Development Mar 29 at 7:02
@MereDevelopment [This is the js] (github.com/dimsemenov/Touchfolio/blob/master/js/…) or in non minimized for. The non-minimized version has an error on line 413 btw. I will try using .replaceWith() and report back. – JPollock Mar 29 at 22:40

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.