Spring Posted July 31, 2011 Share Posted July 31, 2011 Hey, I'm new to Jquery and I'm wondering what my mistake is here, it's working fine with JS! Js code: function mouseOver(){ var oWrap = document.getElementById('wrap'); oWrap.style.backgroundColor = "#FFFFFF"; oWrap.style.filter = "alpha(opacity=100)"; oWrap.style.opacity = 1.0; } And here's the Jquery: $('#wrap').mouseover(function (){ $(this).css({ 'background-color':'#FFFFFF', 'filter':'alpha(opacity=100)', 'opacity ':'1.0' }); }); Quote Link to comment https://forums.phpfreaks.com/topic/243418-working-with-traditional-js-but-not-jquery/ Share on other sites More sharing options...
nogray Posted July 31, 2011 Share Posted July 31, 2011 In JQuery, you wouldn't need to set the filter style (jquery will do it for you). Other than that, the code looks correct. Make sure to include it when the document is ready. Quote Link to comment https://forums.phpfreaks.com/topic/243418-working-with-traditional-js-but-not-jquery/#findComment-1249977 Share on other sites More sharing options...
AyKay47 Posted August 1, 2011 Share Posted August 1, 2011 the only thing that I see here is that you include a space in the opacity quotations.. what is actually going wrong here? simply not working when you mouseover? Quote Link to comment https://forums.phpfreaks.com/topic/243418-working-with-traditional-js-but-not-jquery/#findComment-1250000 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.