Ok, I decided to weigh in on this one...
The specific question
The text of the question in question is:
I have a site in wordpress and added menu in sidebar and I have changed the size of some tabs to show them separate, I just want when site loads then 2nd 3rd 4th 5th and 6th tab should be hide and open on when click on foirst tab then hide on clicking first tab,
$(document).ready(function(){
$("#main-menu ul li:nth-child(2)").click(function(){
$("#main-menu ul li:nth-child(n+2):nth-child(-n+6)").toggle();
});
});
Also I don't know where should I put my javascript function in wordpress website,
Given that this question is off topic and that any answers that it gets here would cause more moderator work (migrating it to SO, duping it there, merging it there), closing it promptly here would be a good thing and reduce moderator work and the drain on community close votes.
This question was asked at 1:07 UTC, and closed at 20:17 UTC. A tad bit over 19 hours. That's awkward and could have easily gotten some 'helpful' user posting an answer here. Fortunately it didn't. But if it did, it would have meant a flag for moderators to migrate it to the correct site where it is on topic (and as of this writing, still open).
For this question, I believe the flag should have been acted upon and closed. I personally feel it's a rather clear cut case of an off topic question and a mod close could have prevented other possible answers in the wrong place. We get those often enough.
We should endeavor to avoid bouncing people and questions around form site to site - thats a bad experience. We should furthermore, endeavor to avoid the situations where we would be deleting questions that are completely inappropriate here (off topic fix my code) but have somehow garnered answers that would end up being deleted here (no one likes having their material deleted). Both of these require prompt action to avoid a poor experience; and sometimes the community isn't and can't be prompt enough.
The general case
If a question is on topic on both sites, being cross posted is not a reason to close as off topic - its on topic.
However, I've often found that questions that are posted identically to two or more sites suffer from lack of specificity and are often (not always) too broad or unclear. Those are perfectly acceptable reasons to close a question. This is especially frequent in situations where the OP wants "diverse answers from multiple communities." Many times, these questions are seeking discussion rather than solving problems.
I will point out that posting identical questions on multiple sites I consider to be very rude to the communities of those sites - having multiple groups working on solving a problem when its already solved somewhere else is wasting the time of multiple users. Having questions where it didn't get an answer on one site but did on another leads to fragmentation of knowledge across the network and poor search results.
Across the metas
My take on this can be found on Meta.SE: Can cross-posts actually be valuable to two communities, with the exception of being worded identically?.
I'll also point to Are cross-site questions acceptable in rare cases? from Gaming.SE and highlight a bit from there:
The reason cross-posting is frowned upon is because it's the hallmark of a vague question. If it's broad enough to be equally applicable to multiple SE sites, you haven't refined the question enough. More thought needs to be invested to see which group would be best able to answer your question. You need to decide which site you think has the best chance of answering the question. If you don't manage to get an answer, feel free to delete and ask on another. That way, there's no duplication of effort, no bickering, and if you get an answer on another site, it will be applicable to those that view it.
In conclusion
While it may not be off topic, and posting an identical question on multiple sites can sometimes be acceptable, it will be judged with a more critical eye as to how it is applicable here. The question may very well receive borderline votes of too broad or unclear because of how the question applies here rather than there.