Results 1 to 5 of 5

Thread: Help with Image Rollover

  1. #1
    Join Date
    Jul 2012

    Question Help with Image Rollover

    Hi everyone!

    I'm truly hoping y'all can help me. I have a site I'm developing, and the owner wants all the images to have rollovers. They all work EXCEPT the latest, which are small social icons. You can view the site at archwaysandceilings DOT com.

    The images in the left sidebar all use a script that looks like this:

    [CODE]btnTwitteron = new Image();

    btnTwitteron.src = "images/bt_twitter_f2.gif";

    btnTwitteroff = new Image();

    btnTwitteroff.src = "images/bt_twitter.gif";[CODE]

    The image then uses this code:

    <a href="https://twitter.com/Archking57" target="_blank" onmouseover="turnOn('btnTwitter')" onmouseout="turnOff('btnTwitter')" ><img src="images/bt_twitter.png" name="btnTwitter" alt="Archways &amp; Ceilings on Twitter" />
    This is the code used to do all of the images in the left sidebar, and all of them work!

    Alternatively, on the images in the right side, I used this:

    <a href="ceilings-made-easy.php" onmouseover='Ceilings.src="images/Ceilings-Product-Line-Mouse-Over.jpg"' onmouseout='Ceilings.src="images/Ceilings-Product-Line-Base.jpg"'><img src="images/Ceilings-Product-Line-Base.jpg" name="Ceilings" alt="ceiling systems" /></a>
    This code works on those images, yet when I tried it on the social images, that won't work either.

    I've tried both forms of code, I've changed the file type of the images (they started out as .png, I tried .jpg & .gif) and nothing is working.

    SOMEONE PLEASE HELP ME!!!! I'm at the end of my rope! I've spent hours going over every letter, checking the syntax and I can't come up with anything that is stopping it from working.


  2. #2
    Join Date
    Jun 2012
    Dark Side of the Moon
    I took a look at the site address you gave and maybe I am just blind but I see social icons on the left, and then some on the bottom. Neither did anything on rollover, so can't tell exactly what is going on. I don't see anything really wrong with the code either, the only thing I would do is change the property info like this, and see if that does it, otherwise maybe you can pin point it for me so I can get a better idea of whats happening:

    <a href="ceilings-made-easy.php" onmouseover="Ceilings.src='images/Ceilings-Product-Line-Mouse-Over.jpg'" onmouseout="Ceilings.src='images/Ceilings-Product-Line-Base.jpg'"><img src="images/Ceilings-Product-Line-Base.jpg" name="Ceilings" alt="ceiling systems" /></a>
    All I did was swap the ' for " at the start, and use ' on the in. Not sure if that will help you, but hey, give it a shot right. I like to use double quote for the main property, and single on the in, that way I have a reference. Sorry if that doesn't do it, but I'm a little stumped like you are.
    I love how people get an attitude when THEY asked for help.

  3. #3
    Join Date
    Jul 2012
    Thanks for your response. I'm completely stumped. It's supposed to do a rollover, and I've tried switching the ' and " but I copied the code that IS working (on the other images on the page) and I cannot for the life of me figure out why these images won't work...did you look at the page source code? You can see the other images work just fine, and have the exact same code! I'm pulling my hair out! LOL

  4. #4
    Join Date
    Jun 2008
    Use CSS Sprites. Much easier and you don't need Javascript.

    Here is a cool one I did.

    The JavaScript on that one is for the 'tooltip area' that lights up with information below the buttons. The Buttons themselves are purely CSS and do not need an image preloaded.

    You can also try using 'sliding-door' sprites.
    I'm building a generator for them, but it is not done yet... there is a concept running here:
    Sprites Generator
    But it is not ready for showtime as you cannot download the full script... you can however, sneak a peek at how it works once you generate a sprite you like!

    Here is a simpler one I did as well:
    This one will show you the idea of how it works without adding the complication of a javascript tooltip as above!

    Good luck!
    (Get rid of rollovers, they are so 1999!)
    Last edited by donatello; 07-31-2012 at 01:58 AM. Reason: Updated Fiddle...

    Privacy Policy Generator

  5. #5
    Join Date
    Jul 2012

    Talking Thanks!

    Thanks, I am going to try the CSS route. I'll let you know how it goes.

    I just don't understand why the original code that is working everywhere else on the page, isn't working here. The ONLY thing I can come up with is that the images are so small. But that just sounds ridiculous. LOL

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.09410 seconds
  • Memory Usage 2,877KB
  • Queries Executed 13 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (5)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates