Re: [jQuery] highlighting

2010-01-06 Thread brian
$target.css('...')

Or, better:

$target.addClass('SomeClassName');

On Tue, Jan 5, 2010 at 10:35 AM, metalmini  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> 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

2010-01-05 Thread metalmini
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  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

2009-01-08 Thread Martynas Brijunas

Hello,

I am looking for some guidance on how to achieve a simple objective. I
have multiple  elements on a page, and within each  there
are 4  elements. Within each  there is an . My goal is to
apply a class to each of these  upon rendering the page.


  
  
  
  


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

2008-11-19 Thread [EMAIL PROTECTED]

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   is inside a , 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()

2007-07-19 Thread Michael E. Carluen
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