Results 1 to 5 of 5

Thread: Animated/static logo swap

  1. #1
    Join Date
    Feb 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Animated/static logo swap

    before you say it, yes, im a newb.

    is there a code to... hard to explain. some way to make a button that changes the logo at the top of your site when you click the button. Thing is, i have an animated logo and a non-animated logo for my site. so, like switch them around when you click the button.

    Q2: my site is actually a PHPBB2 forum, so i need a code that makes a home page that, when i post a new announcment, and ONLY me, it comes up on my homepage. the perfect example is the http://www.droidz.org homepage.

    ALL inputs will help

    cheers all,
    steve AKA pivoteer

    P.S. all questions i ask will be posted here, not in other threads. just a heads-up. thanks.
    Last edited by Pivoteer; 02-22-2008 at 11:57 AM.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    is there a code to... hard to explain. some way to make a button that changes the logo at the top of your site when you click the button. Thing is, i have an animated logo and a non-animated logo for my site. so, like switch them around when you click the button.
    Code:
    <img src="logo-static.png" alt="Site Logo" id="logo">
    <button id="logo-button">Click me!</button>
    <script type="text/javascript">
      document.getElementById("logo-button").onclick = (function(n) {
        var c = new Image();
        c.src = n;
    
        return function() {
          var logo = document.getElementById("logo"),
              t = logo.src;
          logo.src = n;
          n = t;
        };
      })("logo-animated.gif");
    </script>
    P.S. all questions i ask will be posted here, not in other threads. just a heads-up. thanks.
    Please don't -- post in the appropriate forums for their subjects (the former should be in the JS forum, the latter in the PHP forum, I'm just going to move the whole thread to JS for now). Also, if you post questions in separate threads you can give a descriptive title, which will allow people to decide faster whether they can help you or not.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Feb 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oh, sorry.

    thanks for your help, and ill try and use my commonsense next time

    cheers again,

    pivoteer

    EDIT: thanks twey, that post helped, but i would still really like a code for my second question. that would probably be my last question here, cos its all my site needs. its becoming really active now.
    Last edited by Pivoteer; 02-22-2008 at 12:52 PM.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It's more of a phpBB modification than anything else, so I'm not entirely comfortable writing it without a suitable test environment. It may very well already exist, however; check http://www.phpbbhacks.com/.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Feb 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok, cheers ill check it out.

    ur da best

    pivoteer

Bookmarks

Posting Permissions

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