vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   MouseOver Effect - Right Method? (https://vborg.vbsupport.ru/showthread.php?t=240593)

Trip 04-16-2010 04:54 PM

MouseOver Effect - Right Method?
 
Quick question. I am creating a mouse over effect for a couple of small icons and was just wondering if the method I am using is the most efficient and common way of achieving this. Wrapped below is the main part of the code I am using. It works and it's XHTML valid, however, I was wondering is this the best way to create a mouse over effect.

Code:

onmouseover="document.but.src='icon2.gif'"
onmouseout="document.but.src='icon1.gif'"


Hell Bomb 04-25-2010 01:19 AM

*EDIT*
If I am not mistaken this uses some javascript so this may not be the best way to do it. I'll post back when I can find a better way to do it.

If anyone has any good ways to do this let me know :) I am having trouble finding the right method that will work well in vb3.8.5

Trip 04-27-2010 03:10 PM

I agree, java can be a little dirty in this case. I have it running without issue but I don't feel great about the way I'm doing this. It does work in all browsers, except IE6, of course :rolleyes:.
Thanks for posting :)

DavidsMods 04-27-2010 04:09 PM

It could be possible for you to use CSS either. Something like:

HTML Code:

<style type="text/css">
.myclass {
background: #000 url(PATH_TO_IMG);
}

.myclass:hover {
background: #000 url(PATH_TO_OTHER_IMG);
}
</style>

<div class="myclass">
Content
</div>



All times are GMT. The time now is 06:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01027 seconds
  • Memory Usage 1,712KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete