Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    array logical toggle teaser

    I have a set of tiles and want to toggle their colour onclick
    My classes are simply .a .b etc.

    Code:
    var colorOld = ['a','b','c','d','e','f','g','h','i','j'];
    var colorNew = ['j','i','h','g','f','e','d','c','b','a'];
    
    $.each(colorOld, function(index, value) { $('.'+value).toggleClass(colorNew[index]); });
    The obvious bug is start a>j then j>a at end.
    I confess logic is not my strength and I can't see what's wrong but, from an aesthetic point of view the mix just looks yuk.
    If you want to play about here is my minified class sample:
    Code:
    <style>.a {background-color:#F00}.b {background-color:#F80}.c {background-color:#FF0}.d {background-color:#0F0}.e {background-color:#0F8}.f {background-color:#0FF}.g {background-color:#08F}.h {background-color:#00F}.i {background-color:#F0F}.j {background-color:#F08}TD {width:10%;height: 111px;text-align:center;font-family:sans-serif}</style><table width=70%><TR><TD class=a>A</TD><TD class=b>B</TD><TD class=c>C</TD><TD class=d>D</TD><TD class=e>E</TD><TD class=f>F</TD><TD class=g>G</TD><TD class=h>H</TD><TD class=i>I</TD><TD class=j>J</TD></TR></table>
    The basic code works I am just trying for a bit more colour pizzazz mix.

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,087
    Thanks
    38
    Thanked 498 Times in 492 Posts
    Cross posting to other forums at the same time is considered bad form if you don't ever check the answers given.

    See: http://www.webdeveloper.com/forum/sh...-toggle-teaser

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,027
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    If you post in multiple forums you will find that you may not get an answer in any of them. People do not want to waste time answering a question when it has perhaps already been answered elsewhere.
    There are few things in forums more irritating than taking the time to unsnarl someone's markup, javascript and css, figure out the fix, and post it only to find you've wasted your time because a duplicate post in another forum has already been answered.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #4
    New Coder
    Join Date
    Sep 2006
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    independent opinions

    I admit to some surprise at your comments here.

    ever check the answers given
    I certainly did that.

    taking the time to unsnarl someone's markup, javascript and css, figure out the fix
    And you clearly spotted both posts - but took time in neither - other than to carp on.

    you may get conflicting answers...
    Or, in fact complimentary or supplementary answers - or even better answers.

    Isn't there something open and free about the web that allows us to seek a range of opinions from a variety of sources? If these two forums are politically or technically linked in some way - ie. the *same forum* then your comments are valid. The same moderators likely receive notification from both. It this is the case then it ought be noted somewhere. Perhaps it is and I missed it.

    I am sorry to quip back but it seemed a bit on the over-? side.

    As JMRKER replied in the other forum I will continue there.

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,027
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    The correct procedure is to post your question in only one forum at a time. If after a few days your question has not been answered (to your satisfaction) then it is fine to post again in another forum. But if you post in multiple forums simultaneously then my remarks apply.

    If you ignore this advice then the outcome is that people will place you on their ignore lists. Remember, you are asking for help from volunteer contributors who have limited time and are not standing around 24/7 just to anwer your question.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,567
    Thanks
    78
    Thanked 4,385 Times in 4,350 Posts
    Further, if you do end up crossposting, after a reasonable time, then you need to *TELL* people you have done so. In EACH thread, put in a note referencing the other thread(s) so that people can easily find out if you have already been answered.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #7
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,087
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Thumbs up

    Quote Originally Posted by Old Pedant View Post
    Further, if you do end up crossposting, after a reasonable time, then you need to *TELL* people you have done so. In EACH thread, put in a note referencing the other thread(s) so that people can easily find out if you have already been answered.
    Brilliant!

    Another idea: If you figure out your problem by yourself, post your solution rather than just saying "I got it fixed."

  • #8
    Regular Coder
    Join Date
    Jan 2013
    Location
    Germany
    Posts
    578
    Thanks
    4
    Thanked 77 Times in 77 Posts
    We do not need to prove that cross-posting is frowned upon. You will (and did) learn that simply by the reactions, which, by the way, I completely share.

    And spotting both posts and not helping, in many cases, is a matter of principle. I could very easily spare the time to write an actual answer rather than this – but I don't, because it would reinforce this behavior. Cross-posting as a long history of being considered "bad" and has been out there since Usenet.

  • #9
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,567
    Thanks
    78
    Thanked 4,385 Times in 4,350 Posts
    Quote Originally Posted by jmrker View Post
    Brilliant!
    I've been brilliant for a long time. <grin/>

    See my first post/FAQ about this:
    http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=110

    More than 12 years ago. My, how time files when you are having fun. ("Mommy, when does the fun part start?")
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #10
    New Coder
    Join Date
    Sep 2006
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts
    The responses here are quite clear. Thank you.

    What about:
    Isn't there something open and free about the web that allows us to seek a range of opinions from a variety of sources? If these two forums are politically or technically linked in some way - ie. the *same forum* then your comments are valid. The same moderators likely receive notification from both. It this is the case then it ought be noted somewhere. Perhaps it is and I missed it.
    esp. "... forums are politically or technically linked..."
    It does seem as if there are shared moderators.

    Wikipedia... crossposting
    Crossposting is the act of posting the same message to multiple information channels... as distinct from multiposting . ... actions against crossposting individuals (severe)
    I would say that I have indeed been multiposting - but accused of crossposting.
    ping...
    Last edited by arfa; 08-28-2013 at 11:23 PM.

  • #11
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,567
    Thanks
    78
    Thanked 4,385 Times in 4,350 Posts
    Same message, same question: I don't see the difference. Look, let us all let this one go. As I wrote back in 2001, I think one or two offenses should just get warnings, not worse. Okay, the warning has been issued. Now let's get back to answering questions.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #12
    New Coder
    Join Date
    Sep 2006
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    diff Q.

    No, there is a difference.
    Crossposting is within a single environment - ie. in different sections or areas of the same forum. Like incest? Bad.
    Multiposting is about independent environments - different forums, independent entities. Like free love? Good.

    I persist because I feel wrongly accused.

    You all may perceive codingforums.com and webdeveloper.com as the same place but I have no reason to do so.

    let's get back to answering questions.
    Question 1: Are codingforums.com and webdeveloper.com the same entity?
    Question 2: Can you, anyone, concede the difference between Crossposting and Multiposting?

  • #13
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,969
    Thanks
    56
    Thanked 557 Times in 554 Posts
    It doesn't matter what it's called. It's been explained to you from about 15 different angles why doing what you did will win you no friends here, and subsequently offers of help will dry up. You can argue it from a semantic point of view and you will end up one lonely winner if you do secure such a pointless victory.

    Bottom line: just don't do it. As far as I know the two forums are not connected in any way, except that for some reason some people choose to cross-, multi-, whatever- post on them and some members here also answer questions there.

  • #14
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,567
    Thanks
    78
    Thanked 4,385 Times in 4,350 Posts
    First of all, Wikipedia's definition is way out of date.

    There's no way to actually *DO* crossposting, as Wikipedia defines it, into multiple forums in today's environment. If you go on to read the rest of that ancient article, you will see that it describes how to do it in UseNet. To wit:
    it is possible to specify that the message is intended for more than one newsgroup.
    Newsgroups: sci.space,comp.simulation
    In this case, the message will be visible both in the sci.space and comp.simulation newsgroups.
    And the rest of the discussion is relevant only to UseNet.

    In point of fact, that article has been irrelevant, in general, to normal forums for over 15 years now. It was certainly wrong (well, it probably didn't exist yet) in 2001 when I wrote the above referenced FAQ.

    And so no, I do *NOT* concede there is a difference between crossposting and multiposting in a normal internet forums environment.

    Wikipedia is not some sort of god-sent definitive source. I can't tell you how many errors I have found in it over the years. If you rely solely on it, you will find that (depending on when you read the articles in question) that the Holocaust never happened, that Obama was born in Kenya, and who the heck knows what else.

    I was ready to forgive and forget. Now I'm not so sure.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #15
    Regular Coder
    Join Date
    Jan 2013
    Location
    Germany
    Posts
    578
    Thanks
    4
    Thanked 77 Times in 77 Posts
    To be fair, though, there are a lot of mistkaes in books – only that they are way harder to get rid of, especially if it was written intentionally.

    Anyway – call it what you want. People do not like it for reasons that don't depend on its name. I've been in many forums (with many different topics – math, programming, arts, …) and in every single forum you will come across a post, take your spare time(!) to write an answer, just to find that it was asked and answered somewhere else already. As being on the side of those answering, it can get pretty frustrating.

    And that's why a lot of people decide to not answer on cross-posts on principle. Though you certainly will find people who don't care and will answer (in my experience, most newbies won't care – but that's not necessarily a good thing for you).

    In the end, to me, all that counts is the person's attitude. You can agree or not on what this is about, but if you do not respect that people dislike this and keep doing it, you simply won't get any answers (from me and some others). If you respect the rules, whether or not you agree, you're fine.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •