jQuery dropdown menu CSS manipulation

I'm using the jQuery Simple Drop-Down Menu Plugin from http://javascript-array.com/scripts/jquery_simple_drop_down_menu/ In their example, when you hover a menu item, a red dropdown box appears. I can't figure out how to make the main tab red as well while the dropdown is visible. It should remain red when you also hover on the dropdown and return to normal via timeout. The code uses a `timeout` function so I'll have to somehow implement it into that. var timeout = 500; var closetimer = 0; var ddmenuitem = 0; function jsddm_open() { jsddm_canceltimer(); jsddm_close(); ddmenuitem = $(this).find('ul').css('visibility', 'visible');} function jsddm_close() { if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');} function jsddm_timer() { closetimer = window.setTimeout(jsddm_close, timeout);} function jsddm_canceltimer() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null;}} $(document).ready(function() { $('#jsddm > li').bind('mouseover', jsddm_open) $('#jsddm > li').bind('mouseout', jsddm_timer)}); document.onclick = jsddm_close; I tried making a function for changing the background CSS and adding it to mouseover and mouseout, but it either changes the background for all menu tabs or nothing happens. Does anyone know a good solution?
you want to make red color tab as blue color ?

以上就是jQuery dropdown menu CSS manipulation的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏