Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript changing css property with javascript

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35932
    mikeman
    Member

    Hellooos so I was actually able to achieve the concept of what i need but not entirely and im to noobish to know where to go from the code i have below.











    what im trying to accomplish is when someone clicks a Link, that it will change a CSS property, and when they click it again, it changes back.. and of course the “Link” doesnt link to another url.. .

    any ideas? thanks!

    #93902

    sorry, call me lazy but had to try this in jquery

    here you go…hope this works








    Click to toggle






    #93966

    just update the jquery code…


    // put the id or class you wanted to target
    $(".box1, .box2").click(function () {

    // just copy the id or classes in here
    $(".box1, .box2").toggleClass("highlight");
    });

    here some resources btw…so you can get to know more about jquery , just in case

    http://jquery.com/
    http://docs.jquery.com/Main_Page

    http://api.jquery.com/category/manipulation/class-attribute/

    – i dont know what are you trying to achieve on this website of yours, can you tell?

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.