I think that issue usually happens with <p> and <div>. Try adding a CSS background to the element to see how much it spans on your document, and you may see that the <p> spans 100% horizontally. I usually find using <span> instead to fix the issue.
On Jan 30, 8:23 am, surreal5335 <surrea...@hotmail.com> wrote: > Ok, well I was able to get to work, but I cant figure out now how to > reduce the hover area. For some reason hovering on any part of the > screen that is horizontal with the text will cause the hover event to > trigger. How can I stop this? > > This the current jquery haddling the event > > $("p#makered").hover(function(){ > $(this).addClass("red"); > > }, > function() { > $("p#makered").removeClass("red"); > $(this).fadeOut(1000); > > }); > > }); > > The css handling the colors and border (which isnt showing up either): > > <style type="text/css"> > > p.green { color: rgb(0,255,0); } > > p.red { > color: rgb(255,0,0); > border: 1px; > } > > </style> > > Here is the html for the text: > > <p class="green" id="makered">Some text</p> > > Thanks a lot for your help on this matter > > On Jan 30, 11:11 am, surreal5335 <surrea...@hotmail.com> wrote: > > > I am having troubles trying to get this function to work. I got the > > first part to work but trying to get the <p> take a whole nother > > action upon hover out. > > > Here is the jquery I am using > > > $("p#makered").hover(function(){ > > $(this).addClass("red"); > > }, > > function() { > > $("p#makered").fadeOut("slow"); > > > }); > > > The css works fine, but with the added jquery function changing the > > text from green to red is no longer happening and firebug says I am > > missing a ' ) ' after "function() {" Tried adding it just to see but > > that doesnt work. Must be something else entirely. > > > Any help? > >