[Javascript] Changing link hover through JS

Skip Evans skip at bigskypenguin.com
Wed Jun 11 10:25:51 CDT 2008


Hey all,

The color that gets set actually comes from a form 
value, via a PhotoShop style color selector from here:

http://ecritters.biz/colorselector/

So with Mike Dougherty's help, I got it going by 
assigning the form value color via mouseover and 
mouseout functions.

Thanks all!!!

I'm new to the list and have learned a lot 
already. I consider myself very good to excellent 
at PHP programming, but now that we're using a lot 
of AJAX I need to get up to speed on JS more, and 
have the book DOM Scripting by Jeremy Keith and am 
finding it quit useful. I would recommend it to 
anyone on the list that doesn't consider 
themselves a JS master of the universe.

Skip

Paul Novitski wrote:
> At 6/11/2008 02:31 AM, Rees, Mark wrote:
> ...
>> if you need something (anything) to change colour on mouseover, one 
>> way is to set a class for it in the CSS, and then apply that class 
>> using JS in the onmouseover event.
> 
> 
> I agree.  It's the difference between embedding the colors in your 
> JavaScript code and separating them out into your stylesheet.  For a 
> superabundance of rationale for separating development layers, google 
> 'separation layers javascript'.
> 
> One way to apply different colors to anchors throughout a page would 
> be to apply incrementally different classes to the anchors which 
> would be reflected in the stylesheet:
> 
>          <a class="anchor001" href="...">...</a>
>          ...
>          <a class="anchor002" href="...">...</a>
>          ...
> 
>          a.anchor001:hover {color: #336699; }
>          a.anchor002:hover {color: #6699CC; }
>          ...
> 
> If the coloration effect is important to the comprehension of the 
> page, I'd apply them server-side so they appeared regardless of 
> whether JavaScript is enabled in the browser.  For more on this 
> subject, google 'progressive enhancement'.
> 
> In my view JavaScript cannot competently replace server-side 
> scripting, it can only enhance.
> 
> Regards,
> 
> Paul
> __________________________
> 
> Paul Novitski
> Juniper Webcraft Ltd.
> http://juniperwebcraft.com 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at lists.evolt.org
> http://lists.evolt.org/mailman/listinfo/javascript
> 

-- 
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison, WI 53703
608-250-2720
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and versatile
PHP/MySQL, AJAX & DHTML development framework.
http://phpenguin.bigskypenguin.com/



More information about the Javascript mailing list