Re: [jQuery] highlighting
$target.css('...') Or, better: $target.addClass('SomeClassName'); On Tue, Jan 5, 2010 at 10:35 AM, metalmini metalm...@gmail.com wrote: Hi guys and galls, Im not really a jquery programmer but i build lots of sites and i love the jquery plugins that i can easily copy and paste. So anyway im building a new site and i am using alot of jquery to emprove usability. So i am using a little script that scrolls easy to the a name=p1/ a html tag. [code] $(document).ready(function(){ $('a[href*=#]').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^ \//,'') location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length $target || $('[name=' + this.hash.slice(1) +']'); if ($target.length) { var targetOffset = $target.offset().top; $('html,body') .animate({scrollTop: targetOffset}, 1000); return false; } } }); }); [/code] This is not my own code, i found it. As i said im not a jquery pro. Anyway i was wondering if it is possible to somehow highlight the div class with a background color to make it stand out more? Something that i can add to this little piece of code? If there are things that i should include please let me know. Thank you very much in advance. Kind regards, Michael
[jQuery] highlighting
Hi guys and galls, Im not really a jquery programmer but i build lots of sites and i love the jquery plugins that i can easily copy and paste. So anyway im building a new site and i am using alot of jquery to emprove usability. So i am using a little script that scrolls easy to the a name=p1/ a html tag. [code] $(document).ready(function(){ $('a[href*=#]').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^ \//,'') location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length $target || $('[name=' + this.hash.slice(1) +']'); if ($target.length) { var targetOffset = $target.offset().top; $('html,body') .animate({scrollTop: targetOffset}, 1000); return false; } } }); }); [/code] This is not my own code, i found it. As i said im not a jquery pro. Anyway i was wondering if it is possible to somehow highlight the div class with a background color to make it stand out more? Something that i can add to this little piece of code? If there are things that i should include please let me know. Thank you very much in advance. Kind regards, Michael
[jQuery] Highlighting the first element in multiple DIVS
Hello, I am looking for some guidance on how to achieve a simple objective. I have multiple DIV elements on a page, and within each DIV there are 4 A elements. Within each A there is an IMG. My goal is to apply a class to each of these IMG upon rendering the page. div class=description a class=colour href=#img class=icon src=/images/icons/ snowwhite.png alt=Snow White/a a class=colour href=#img class=icon src=/images/icons/ deepcream.png alt=Deep Cream/a a class=colour href=#img class=icon src=/images/icons/ mistygrey.png alt=Misty Grey/a a class=colour href=#img class=icon src=/images/icons/ paleivory.png alt=Pale Ivory/a /div I have tried using $(div.description a.colour:first-child img.icon).addClass(icon_selected); but that does not work. Please help as I am going round in circles. Thank you. Best regards, Martin
[jQuery] highlighting elements of the page
Hi, I'm trying to highlights elements of the page on mouseover. I want to highlight all td's h1's and p's when the mouse is over. $(td, h1, p).mouseover(function() { $(this).css(backgroundColor, CC); }); $(p, h1, td).mouseout(function() { $(this).css(backgroundColor, mObj.prevBGColor); }); That doesn't do what I want. Indeed if a p is inside a td, only the td gets highlighted (or maybe the p too, but then since the td is also hightlighted, it doesn't look right) How can I specify that only top element should be highlighted ? Thanks
[jQuery] Highlighting contents of an Input field on click()
Hello jQ folks, (pardon me, but I just got braindead right when I'm trying to wrap-up the final leg of a very long day.) I just wanted to highlight the contents of an input field (read-only) on a .click() event. Similar to when your click the url or embed fields in YouTube to highlight the field contents. I appreciate a brain jump-start from anyone, anywhere. Mucho thanks! Michael