抹桥的博客
Language
Home
Archive
About
GitHub
Language
主题色
250
107 words
1 minutes
jQuery Plugin - changeBg

I’ve refined the jQuery code from my previous blog post and turned it into a new plugin ChangeBg. It can set the background color for all odd-numbered child elements under a specific tag (Note: these are child elements, not descendant elements), and also add events to all child elements to change their background and font colors on mouse enter and leave.

Usage: `$('select').ChangeBg(bgCol, chBgCl, chCol);` or simply `$('select').ChangeBg();` The function has three parameters, as follows:
  • bgCol Background color for odd-numbered rows, defaults to '#EEE'
  • chBgCl Background color on mouse hover, defaults to '#0066CC'
  • chCol Font color on mouse hover, defaults to '#FFF'

Click here to download

jQuery Plugin - changeBg
https://blog.kisnows.com/en-US/2015/02/08/jquery-plugin-changebg/
Author
Kisnows
Published at
2015-02-08