Results 1 to 3 of 3

Thread: Alternating CMPS/Forums Logo Link + Mouseover (Javascript)

  1. #1

    Default Alternating CMPS/Forums Logo Link + Mouseover (Javascript)

    Hi everyone,

    We have been using vBa for a long time.. it is an amazing piece of software. With a brand new site on the way, and since my navbar would go into chaos when adding a link (custom skin), I decided to make the linked forum logo alternate between cmps home and forumhome. I also wanted to do an image rollover similar to when the facebook logo shows a home icon when you mouseover (on the old facebook, anyway..). I got this working the way I wanted, and want to share it with the community in case anybody else wants to do the same thing.

    Simply, when you mouseover the logo on CMPS home the logo changes to have a community icon, while when you mouseover the logo on forumhome or forum pages the logo changes to have a home icon for CMPS home.

    In your headinclude template, insert:

    Code:
    <script language="Javascript">
    <!--
    //Slide Show script (this notice must stay intact)
    //For this and more scripts
    //visit java-scripts.net or http://wsabstract.com
    
    if (document.images) {
         button1 = new Image
         button2 = new Image
    button3 = new Image
    
         button1.src = '{link to your main logo}'
         button2.src = '{link to logo with cmps home rollover}'
    button3.src = '{link to logo with forumhome rollover}'
     }
    //-->
    </script>
    Then in your header template, replacing the logo code:

    Code:
    <div id="logo"><if condition="THIS_SCRIPT == 'adv_index'">
    <a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]" onmouseover="document.rollover.src=button3.src" onmouseout="document.rollover.src=button1.src">
    <img src="{YOUR MAIN LOGO URL}" alt="$vboptions[bbtitle]" name="rollover"/><else /> 
    <a href="$vboptions[homeurl]?$session[sessionurl]" onmouseover="document.rollover.src=button2.src" onmouseout="document.rollover.src=button1.src">
    <img src="{YOUR MAIN LOGO URL}" alt="$vboptions[bbtitle]" name="rollover" />
    </a>
    </if>
    </div>
    Note that this isn't checked for standards compliance or whatnot, it just works. It might take some trial and error to get it to work... like it did for me. Credits go out to java-scripts.net for the js and mholtum for the dynamic link code.

  2. #2
    Join Date
    Apr 2009
    Posts
    11

    Default

    Screenshot can be?

  3. #3

    Default

    Sure, here are some attached screenshots. First is mouseover on CMPS, second is mouseover on forum, and third is normal (no mouseover) on forum.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Main logo link to (cmps)homepage
    By toejam in forum "How Do I..." Questions
    Replies: 7
    Last Post: 09-07-2011, 11:50 AM
  2. Change Logo link to CMPS
    By Robert Waanders in forum "How Do I..." Questions
    Replies: 2
    Last Post: 05-23-2008, 04:32 PM
  3. Cant open javascript link in cmps
    By Parabellum in forum "How Do I..." Questions
    Replies: 2
    Last Post: 03-24-2008, 02:06 PM
  4. Mouseover hack works with CMPS latest threads
    By trana in forum Modifications (version 3.x & 2.x)
    Replies: 6
    Last Post: 01-28-2007, 08:13 PM
  5. Custom Navbar with mouseover image link buttons
    By Alan2525 in forum Troubleshooting / "How do I..." Questions
    Replies: 9
    Last Post: 05-13-2005, 09:36 AM

Posting Permissions

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