We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1416
    • 75 Posts
    Been fiddling around with as to how to set a class when clicking an anchor-link.

    Actually I´ve been at it for some hours now. laugh

    I tried with jQuery and mootols, but I just for the love of my life can´t get it to work.
    I´m 100% shure I got the libraries to load, since I added an alert function just to test if they loaded.

    They do load in FF, but seems like they don’t load at all in IE8. sad
    Took me one hour to figure that out. laugh

    I then spent some time trying to find a toggle I could adapt to what I want, but hey ho how difficult that was to do.

    All I really need is the class to change when I click on an anchor so I can style it differently.
    http://www.fixarn.be/test.html - Here is how it looks right now, and the links in the center column is actually the anchors.
    This page is really generated in MODx, but for testing purposes I used only the generated source.

    Cheers
    Amrit
      • 26931
      • 2,314 Posts
      hi

      ...well, it’s working now. anchors with the class "next" will get the class "selected" when clicked, and removed when clicked again...

      jan
        • 1416
        • 75 Posts
        Well...
        jQuery doesn´t work for me in IE8, so if you suggest I should use jQuery that won´t be possible.
        I downloaded the latest release last night and I just couldn´t get it to respond, though it did respond in Safari, FF, IE6...

        Then I´m not shure wheter you suggest I use fancypants or not. (I do use it on some other sites, and it works great)

        Cheers
          • 26931
          • 2,314 Posts
          sorry, i just checked your link in FF3.

          unfortunately i can’t check in IE8 at the moment, because i don’t have it installed...btw. do you know about the best way to install IE8 as a standalone? right now i’ve got IE6, and IE7 as standalone?

          jan
            • 1416
            • 75 Posts
            Well, in IE8 it really doesn´t work. sad

            I don´t know about a standalone for IE8, since I´m running another server for testing purposes. (I6 and 7 on that one and 8 on this one)

            But I would take a look at this:
            http://www.xenocode.com/browsers/
            Then you can test all browsers, without actually installing them.

            Cheers
              • 4310
              • 2,310 Posts
              @sharkbait
              You can install IE8 over the top of IE7 and then use compatibility mode in IE8, which renders page as IE7.
              I’ve found it to work okay so far.
                • 26931
                • 2,314 Posts
                @Amrit

                thank you for that link, i stumbled upon that site earlier...i find it difficult to understand how it works though

                @bunk58

                thank you for the reply

                compatibility mode in IE8, which renders page as IE7
                is that the same as rendering the sites using
                <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
                which i read is not 100% like IE7, also concerning js-frameworks

                jan
                  • 4310
                  • 2,310 Posts
                  Jan,
                  Probably the same as the meta tag method, but I haven’t seen any differences yet.