Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- problems understanding jquery methods in script: get(), and variables


daveVk - 11:49 pm on Jul 18, 2012 (gmt 0)


this and calledform are Dom elements

$(this) $callFrom and $(callFrom) are jQuery objects represents a list of dom elements.

Comparing 2 separately created jQuery objects will always fail for as they may represent the same Dom elements, but they are separate jQuery objects.

( $(this) == $(this) ) is false
( $(this).get(0) == $(this).get(0) ) is true
( $(this).get(0) == this ) is true
( this == this ) is true
$this = $(this);
( $this == $this ) is true

The line
if($(this).get(0) == $calledFrom.get(0)){
is more simply
if(this == calledFrom ){
as .get(0) gets first dom element is jQuery object, that is $(this).get(0) returns this ditto for calledFrom.

My assertion about this being window is wrong, as I see you are looping thru each thumbnails link

$('.thumbnails a').each(function(){

so all but but calledFrom fade to 0.5


Thread source:: http://www.webmasterworld.com/javascript/4476522.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com