Welcome Guest!
Please login
If you do not have an account yet on The Web Squeeze forums, please Register! It’s FREE and there are many benefits:
- Receive Fast Advice
- Learn Programming Languages
- Get Professional Website Reviews
- Quick Troubleshooting Assistance
How Would One Fuse This Simple Function In Jquery?
This is a discussion on How Would One Fuse This Simple Function In Jquery?, within the Javascript section. This forum and the thread "How Would One Fuse This Simple Function In Jquery?" are both part of the Frameworks category.
![]() ![]() |
Jul 4 2008, 01:54 AM
Post
#1
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 146 Joined: 3-July 08 |
This is a simple jquery rollover which seems to work alright. I'm just wondering if its possible to merge them to keep it DRY
CODE $j(document).ready(function() { $j(".navtab").mouseover(function() { $j(this).addClass("on"); }); }); $j(document).ready(function() { $j(".navtab").mouseout(function() { $j(this).removeClass("on"); }); }); Any ideas? This post has been edited by cosmicbdog: Jul 4 2008, 01:56 AM |
|
|
Jul 4 2008, 04:51 AM
Post
#2
|
|
![]() Squeeze Machine ![]() Posts: 766 Joined: 13-February 08 From: Catching the squeezed drips downunder. |
CODE $j(document).ready(function() { $j(".navtab").hover( function() { // Mouseover function $j(this).addClass("on"); }, function () { // Mouseout function $j(this).removeClass('on'); } ); }); That ought'a do it. -------------------- |
|
|
Jul 4 2008, 06:08 AM
Post
#3
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 146 Joined: 3-July 08 |
CODE $j(document).ready(function() { $j(".navtab").hover( function() { // Mouseover function $j(this).addClass("on"); }, function () { // Mouseout function $j(this).removeClass('on'); } ); }); That ought'a do it. -- bs... there's a hover function prebuilt??!?! oh man... why did i take so long to get into jquery? thank you... /me heads towards the jquery documentation to find more jewels |
|
|
If you found The Web Squeeze to be helpful, please donate so we can keep this site FREE, FRESH, and fortified with Web Design & Development info!
![]() ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
1 | Daniela | 488 | 15th February 2008 - 06:58 AM Last post by: craig |
|||
![]() |
14 | edd | 609 | 15th May 2008 - 01:59 AM Last post by: Antti |
|||
![]() |
13 | shanedizzle | 457 | 11th April 2008 - 03:31 PM Last post by: joey |
|||
![]() |
2 | Jason | 382 | 6th May 2008 - 07:33 AM Last post by: Rakuli |
|||
![]() |
8 | unitedcraig | 575 | 9th September 2008 - 10:03 PM Last post by: Monie |
|||






Jul 4 2008, 01:54 AM











